TurboCAD SDK Documentation

TurboCAD SDK

TurboCAD SDK Site Notes

Welcome to the TurboCAD SDK website. IMSI is committed to providing a software development environment to facilitate and encourage the development of 3rd-party application plug-ins to TurboCAD.

The SDK is a continuously evolving resource for the development community. On this site you will find the latest SDK documentation, sample code and executables, as well as SDK License agreements. As the SDK is an ongoing, dynamic work, we welcome your feedback and suggestions. Please contact IMSI at: tcsdk@imsisoft.com. You can also access our SDK forums to report issues, ask questions and see what other developers are doing.

Requirements

This site uses the Microsoft Html Help ActiveX control to organize the topics under a Table of Contents and Index, and requires the use of Internet Explorer for Windows, version 4 for or later. In addition you must have the Html Help control already installed on your computer, or allow the ActiveX download that you'll be prompted for when you first visit the site. For more information on upgrading and installing the latest version of this control, please visit the pages on Microsoft's web site.


What's New In This Release

Release Notes: What's New in This Release

July 29, 2002

Object Reference Section is complete. New compiled help file is available under the Downloads section.

Note: If you place tcsdk.chm in the Program folder for TurboCAD (Program Files\IMSI\TCW80\Program), help will be available from within the Visual Basic Editor.

July 21, 2002

Properties in the Object Reference Section are complete.

July, 2002

Work continues on the TurboCAD Object Reference Section.

TurboCAD version 8.2 has been released. Here is a short description of the TurboCAD engine fixes relating to SDK 8.2 functionality:

1.Perfomance improvements were made for:

Accessing table-based collections:

Application Object

objApp.Properties
objApp.Filters objApp.RegenMethods
objApp.Renders
objApp.TieMethods
objApp.NamedColors

Drawing Object

objDwg.Properties
objDwg.BrushStyles
objDwg.LineStyles
objDwg.Blocks
objDwg.Layers
objDwg.Macros
objDwg.PaperSpaces

Execution of Methods:

objTieSets.Add
objTieSet.AddTie

2. Memory leak fixed in method GetDistance (Graphic object)

3. Incorrect internal reference counting in the following:

QuerySet (Layer object)
AddPolys (Graphics object)
AddPolylines (Graphic object)
Delete (GraphicSet object)
EndRender (RenderView object)

4. Crashes in following fixed:

Drawing (RenderView object)
Application (RenderView object)

5. Crashes under some conditions that were fixed:

Delete (Graphic object)
Remove (Graphics object)
Item (Layer object)

6. Incorrect execution for the following fixed:

Type (LWShader object)
RenderScenesGraphicsUpdate (Drawing object)
RenderScenesUpdateChanges (Drawing object)

7. Incorrect execution under certain conditions fixed:

support VT_ARRAY | VT_* property type
objGrfProperty.Type
objGrfProperty.Value

BeginRender of RenderView object fixed for non-"built-in" TurboCAD views

8. Method implemented:

Caption (Application object)

9. Improvements:

Support 3D boolean operations for operands that don't belong to any drawing

June, 2002

Continued updates in the TurboCAD Object Reference Section. The Objects are documented. Properties, Methods and Events will be the next items to be completed.

May, 2002

The TurboCAD SDK has been released and is no longer in Beta. All the SDK documentation is currently being reviewed and updated. The following areas have been recently revised and uploaded to this web site:

TurboCAD SDK Overview
License Agreements
TurboCAD SDK Downloads
The TurboCAD Object Reference

In addition, all example projects have been replaced with new zip files.

The SDK is not available for download on this web site. Please install the SDK from your TurboCAD v8 Professional CD or download.

Note: We have removed the comments portion on the web pages and now direct you to the forums. This will keep all the comments and questions consolidated so that it is easy for everyone to see what is going on.

July 25, 2001

The SDK installer has been re-posted to the site. You will need a copy of the TurboCAD Professional v7.1 installer before you can use the SDK installer. If you only have TurboCAD Professional v7.0 installed, you should first upgrade to v7.1. See this page for information on obtaining v7.1.

July 20, 2001

The documentation now includes license agreements for SDK end-users (for building SDK projects on a single machine) and for developers (royalties required; for distributing SDK projects to others). We have also added a list of re-distributable files for end-users and developers. Please review these and let us know if there are any issues that need to be clarified.

July 13, 2001

The Advanced Projects section has been added to the documentation. This is where to look for information on how to build standalone CAD applications, ActiveX controls, servers, and custom extensions to TurboCAD. We hope you'll give us your feedback.

July 1, 2001

The preliminary SDK is now available for download! Please visit the download page to get your copy. We encourage you to use the new SDK. We hope that you will give us your valuable feedback on all aspects of using the SDK, including licensing terms (what you'd like to see), SDK installation, the documentation (including F1-key enabled integrated VB and VBA help), and samples. We will be trying to finalize the "Advanced Projects" section in the next two weeks, and we'd like to include any other items that you think we've left out.

June 1, 2001

81 VBA, Visual Basic, Visual C++, and VBScript samples have been added to the website and to the compiled help file; you can browse them by going to the Example Projects section of the documentation in the Contents pane of the website. Full text search capabilities in the online and compiled versions should produce results that include these samples.

We are reading your online posted comments. Due to scheduling issues, some of the improvements you have kindly suggested don't appear in this June 1 release, but we will incorporate them as soon as possible. Our next milestone is to include a first draft of the "Advanced Projects" section. Look for it in the next two weeks. After that, we plan a general revision of all topics, and we'll try to bring your comments into the documentation. Please continue to support this effort with your comments. We do appreciate it!

We've also made substantial progress in producing small code snippets that will appear in the descriptive "Exploring In Depth" section. These will be appearing on the site in the next release also.

May 18, 2001

The documentation is now available as a compiled HtmlHelp (.CHM) file for your inspection. &nsbpHowever, we strongly engcourage you to continue to use the online version so that you can post or email us with comments and suggestions. The compiled help file will be shipped with a beta version of the SDK for your testing in the near future.

The reference section has been brought in sync with the (final?) list of objects, events, methods and properties that will be included in the next SDK release, and unimplemented and/or hidden methods and properties have been removed.

Functionality of the documentation system has been improved in two ways. Support for F1 context-sensitive help in VBA has been added to the compiled help file, and to the SDK type libraries. Applies To, Methods, and Properties HtmlHelp links have been added for all objects, methods and properties. The next release will attempt to complete the See Also and Example links.

Description text has been added to the reference method and property topics. Where available from our source code, descriptions of all method and property parameters and return values are shown. Where the descriptions are missing, this has been noted. Hopefully, the next issue of the beta documentation will have these descriptions and those for objects and events completed.

May 4, 2001

We've built dynamic online versions of the HtmlHelp search and linking systems, as well as using the HtmlHelp control for the table of contents and keyword system. The keywords will be expanded towards the end of the documentation release cycle.

There is also a dynamic comment and email feedback system on the site that we encourage you to use to tell us about spelling and content errors and omissions on a per-topic basis.

The newly written documentation has been organized into five sections, comprising over 600 individual topics and has been posted on the beta site.

  • Site Notes This contains information just for the beta program: announcements, how-to instructions, and links to other TurboCAD SDK sites.

  • Overview This contains general information on using the SDK, VBA, and where to get more information.

  • In Depth This contains narrative, task-oriented explanations on how to use the events, objects, methods and properties in the SDK, organized as linearly as we think is possible. We hope that you'll
    find this section the most useful in quickly explaining "how-to" concepts that will get you up to speed fast, while giving a complete coverage of the SDK.

  • Examples This contains an indexed (soon to be keyworded), catalog of new and revised samples.

  • Reference This is the syntax reference for Visual Basic for Applications for every event, object, method and property in the SDK. While it is not yet complete, take a look at the Vertex object documentation as an example.

Please note that we are giving you an early preview of the documentation. You'll see portions of the topics that are incomplete. These are usually denoted by appearing in red text or by being enclosed in [[[Triple brackets]]]. We're working on the documentation as you read this, so bear with us. Apart from these "under construction" parts, we're very interested in finding out what you you think we
have done a poor job in explaining, or areas that we haven't addressed that you feel are important.

We need a banner graphic to use in the top frame! Post your suggestions, or send us a 40x400 image if have something you think is appropriate.


TurboCAD SDK Download

TurboCAD SDK Downloads

TurboCAD SDK Download

Version 8.2 of TurboCAD has been released. You can access the download here.

TurboCAD SDK Example Projects

If you would like to download all projects you can use the links here:

Visual Basic Examples (480K)

Visual Basic for Applications Examples (1.9M)

Visual Basic Script Examples (200K)

Visual C++ Examples (420K)

TurboCAD SDK Compiled Help File

TurboCAD SDK Help File


TURBOCAD SDK END-USER LICENSE AGREEMENT

A. GENERAL AND DEFINITIONS

1. The TurboCAD application ("TurboCAD") and the TurboCAD SDK ("SDK", collectively TurboCAD and the SDK will be referred to as the "Product") are proprietary to International Microcomputer Software, Inc. ("IMSI"), and are protected by Federal Copyright Law. IMSI retains the title to and ownership of all contents of the TurboCAD application and SDK, except those parts licensed to IMSI by others.

2. TurboCAD consists of binary application files and libraries, content, described in total as the "TurboCAD Components". Depending on the type of license that Licensee has chosen, the SDK may consist of documentation, sample applications, tools and utilities, miscellaneous technical information, development toolkits, server applications, and development tools (each, a "Component," and collectively "Components," of the Product). The Product may include groups of Components identified as any one or more of the following: Libraries, Headers, Sample Code, and Documentation. This license defines the rights of the Licensee's rights to use and distribute these Components.

3. The laws of the State of California govern this Agreement. If any provisions are held void or unenforceable, the remainder shall remain valid and enforceable according to its terms.

4. When conflicting language exists between this Agreement and any other agreement included in TurboCAD or the SDK, this Agreement shall supersede. If either Licensee or IMSI employs attorneys to enforce any rights arising out of or relating to this Agreement, the prevailing party shall be entitled to recover reasonable attorneys' fees. Licensee acknowledges that Licensee has read this Agreement, understands it and that it is the complete and exclusive statement of Licensee's agreement with IMSI, which supersedes any prior agreement, oral or written, between Licensee and IMSI with respect to the licensing to Licensee of this SDK. No variation of the terms of this Agreement will be enforceable against IMSI unless IMSI gives its express consent, in writing signed by an authorized signatory of IMSI.

5. Pursuant to the terms and conditions of this Agreement, Licensee is granted a nonexclusive license to use, modify and create derivative works ("Derivative Works") that incorporate source or binary Components included in the SDK.

B. GRANT OF RIGHT TO USE

1. Licensee acknowledges that the Product is of U.S. origin. Licensee agrees to comply with all applicable international and national laws that apply to the Product, including the U.S. Export Administration Regulations, as well as end-user, end-use and destination restrictions issued by U.S. and other governments.

2. Licensee may make a limited number of copies of the SDK to be used by Licensee's employees or consultants for internal development purposes and not for general business purposes or for distribution by any means, and such employees or consultants shall be subject to this Agreement.

3. Unless Licensee obtains a separate Developer License from IMSI, Licensee may use TurboCAD and SDK Components solely for the purpose of internal development, testing or evaluation. Licensee may not:

a. Include TurboCAD and SDK Components in Bundled Products distributed to any third party, or

b. Sell, sublicense, rent, loan or lease TurboCAD and SDK Components to any third party.

C. CONDITIONS OF LICENSE

1. Licensee may not reverse engineer, decompile, disassemble or otherwise reduce the binary object code Components to a humanly perceivable form for any purposes whatsoever, in whole or in part, except and only to the extent that it is expressly permitted by applicable law notwithstanding this limitation.

2. Some of the TurboCAD and SDK components include technology that is licensed by IMSI from Lightwork Design, Limited ("Lightwork") and from Spatial Technologies, Inc. ("Spatial"), as indicated in the "REDIST.TXT" file. IMSI offers no rights for use or distribution of such technology beyond those rights granted by the TurboCAD End-User License Agreement. Licensee must apply for separate licenses from Lightwork and Spatial in order to obtain rights to distribute components that include technology of IMSI's licensors.

3. Licensee agrees that Licensee will treat the Components of the SDK and any Derivative Works with the same degree of care as Licensee accord to Licensee’s own confidential information, which Licensee exercises reasonable care to protect. Licensee’s obligations under this section with respect to particular Components of the SDK shall terminate when Licensee can document that:

a. The Components were in the public domain at or subsequent to the time they were communicated to Licensee by IMSI through no fault of Licensee’s;

b. The Derivative Works were developed by Licensee’s employees or agents independently of and without reference to any information communicated to Licensee by IMSI; or

c. The communication was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the rights of either party under this Agreement.

4. Licensee agrees to protect IMSI's copyright and other ownership interests in all items in this SDK. Licensee agrees that all copies of items in this SDK reproduced for any reason by Licensee will contain the same copyright, trademark, and other proprietary notices as appropriate, as appear on or in the master items delivered by IMSI in this SDK. IMSI and/or its licensors retain title and ownership of the items in this SDK, the media on which it is recorded, and all subsequent copies, regardless of the form or media in or on which the original and other copies may exist. Except as stated herein, this Agreement does not grant Licensee any rights to patents, copyrights, trade secrets, trademarks or any other rights in respect to the items referred to by this Agreement.

D. US GOVERNMENT RESTRICTED RIGHTS

1. Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under FARS 52.227-14, in FARS 52.227-19 or in DFARS 52.227-7013(c)(1)(ii) Commercial Computer Software - Restricted Rights.

E. ASSIGNMENT

1. This Agreement shall inure to the benefit of, and be binding upon, the parties hereto and their successors and legal heirs, but shall not be assignable by either party to any third party except with the prior written consent of the other party. Such consent will not be unreasonably withheld.

F. INDEMNIFICATION

1. Licensee agrees to indemnify, hold harmless, and defend IMSI from and against any claims or lawsuits, including attorneys' reasonable fees, that arise or result from the use or distribution of Bundled Products, provided that IMSI gives Licensee prompt written notice of any such claim, tenders to Licensee the defense or settlement of such a claim at Licensee’s expense and cooperates with Licensee, in defending or settling such claim.

G. TERM

1. This Agreement shall remain in effect until terminated. Licensee may terminate the Agreement at any time by ceasing to manufacture and distribute Derivative Works and Bundled Products of which the SDK is a component, and destroying all copies of the SDK Components.

2. The Agreement will also terminate upon Licensee’s failure to comply with the provisions of this Agreement, or in the event that Licensee becomes subject to any bankruptcy or insolvency proceeding under Federal or state statutes or becomes insolvent.

3. Upon any cause of termination, Licensee must cease to manufacture products of which the SDK is a component and must destroy all copies of the Product and all of its component parts.

4. Section E (Assignment) of this Agreement shall survive any termination.

H. LIMITED WARRANTY

1. IMSI makes no warranty as to the operational performance of the SDK, the accuracy, completeness or usefulness of any information provided with this SDK, or the advisability of using the SDK in conducting Licensee’s business. The SDK is provided "as is" without warranty or representation, either express or implied, as to performance, merchantability or fitness for any particular purpose. The entire risk as to the quality and performance of the SDK is assumed by the licensee.

2. IMSI warrants that the diskettes/CD-ROM on which the Program is furnished will be free from defects in materials and workmanship under normal usage for a period of ninety (90) days from the date of original purchase. Licensee's sole and exclusive remedy in the event of a defect is expressly limited to the replacement of the diskettes/CD-ROM.

3. Because software is inherently complex and may not be completely free of errors, Licensee is advised to verify Licensee’s work and to make backup copies. In no event shall IMSI Software or anyone else who has been involved in the creation, production or delivery of this SDK be liable for any direct, indirect, special, incidental or consequential damages, such as, but not limited to, loss of anticipated profits, business interruption, benefits, use, or data resulting from the use of this SDK, or arising out of any breach of any warranty. Some states do not allow the exclusions or limitation of direct, incidental or consequential damages so the above limitation may not apply to Licensee.

I. CONSEQUENTIAL DAMAGES WAIVER

1. EXCEPT FOR A BREACH OF ANY LICENSE GRANT TO LICENSEE HEREUNDER OR UNDER THE AGREEMENT, IN NO EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDICENTAL, CONSEQUENTIAL, PUNITIVE OR SPECIAL DAMAGES, LOST PROFITS OR LOST DATA, OR ANY OTHER INDIRECT DAMAGES, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

J. ACCEPTANCE

1. INSTALLING THIS SDK INDICATES LICENSEE’S ACCEPTANCE OF THE FOREGOING AGREEMENT. IF LICENSEE CHOOSES TO DECLINE THE FOREGOING AGREEMENT, LICENSEE SHOULD CANCEL THE INSTALL PROCESS.


TURBOCAD SDK DEVELOPER LICENSE AGREEMENT

Company: _________________________________________

Primary Contact: _________________________________

Address: __________________________________________

Telephone: _______________ Email:____________________

Licensed Components:

Core _________ Filters _________ Lightwork _________ Spatial __________

A. GENERAL AND DEFINITIONS

1. The TurboCAD application ("TurboCAD") and the TurboCAD SDK ("SDK", collectively TurboCAD and the SDK will be referred to as the "Product") are proprietary to International Microcomputer Software, Inc. ("IMSI"), and are protected by Federal Copyright Law. IMSI retains the title to and ownership of all contents of the TurboCAD application and SDK, except those parts licensed to IMSI by others.

2. TurboCAD consists of binary application files and libraries, content, described in total as the "TurboCAD Components". Depending on the type of license that Licensee has chosen, the SDK may consist of documentation, sample applications, tools and utilities, miscellaneous technical information, development toolkits, server applications, and development tools (each, a "Component," and collectively "Components," of the Product). The Product may include groups of Components identified as any one or more of the following: Libraries, Headers, Sample Code, and Documentation. This license defines the rights of the Licensee's rights to use and distribute these Components.

3. The laws of the State of California govern this Agreement. If any provisions are held void or unenforceable, the remainder shall remain valid and enforceable according to its terms.

4. When conflicting language exists between this Agreement and any other agreement included in TurboCAD or the SDK, this Agreement shall supersede. If either Licensee or IMSI employs attorneys to enforce any rights arising out of or relating to this Agreement, the prevailing party shall be entitled to recover reasonable attorneys' fees. Licensee acknowledges that Licensee has read this Agreement, understands it and that it is the complete and exclusive statement of Licensee's agreement with IMSI, which supersedes any prior agreement, oral or written, between Licensee and IMSI with respect to the licensing to Licensee of this SDK. No variation of the terms of this Agreement will be enforceable against IMSI unless IMSI gives its express consent, in writing signed by an authorized signatory of IMSI.

5. Pursuant to the terms and conditions of this Agreement, Licensee is granted a non-exclusive license to use, modify and create derivative works ("Derivative Works") that incorporate source or binary Components included in the SDK, and to distribute compiled version of such Derivative Works in object code format solely as incorporated in the object code format of such Products ("Bundled Products").

B. GRANT OF RIGHT TO USE

1. Licensee acknowledges that the Product is of U.S. origin. Licensee agrees to comply with all applicable international and national laws that apply to the Product, including the U.S. Export Administration Regulations, as well as end-user, end-use and destination restrictions issued by U.S. and other governments.

2. Licensee may make a limited number of copies of the SDK to be used by Licensee's employees or consultants for internal development purposes and not for general business purposes or for distribution by any means, and such employees or consultants shall be subject to this Agreement.

3. Licensee is granted a non-transferable, non-exclusive license for the internal or external distribution of the SDK within the Bundled Products as restricted by Sections C (Conditions) and D (Distribution) below.

4. In general, for each license Licensee has acquired for the Product, one individual is authorized to use the Product according to the terms of this Agreement. Unless expressly stated otherwise, the Product may not be separated for use by more than the one individual authorized to use the Product. Specifically:

a. If Licensee is an individual, IMSI grants to Licensee as an individual a personal, nonexclusive license to make and use copies of the Product in accordance with the terms of this Agreement, provided that Licensee is the only individual using the Product.

b. If Licensee is an entity, IMSI grants to Licensee the right to designate one individual within Licensee’s organization to have the sole right to make and use copies of the Product in accordance with the terms of this Agreement.

5. The designated Primary contact named above is responsible for all distribution license reporting due to IMSI according to the terms of this agreement. The Primary contact named above can be changed without prior written notice to IMSI.

6. Licensee is granted the right to distribute only those component files specifically listed in the "REDIST.TXT" file, included in the SDK Components, as the ones designated for distribution.

C. CONDITIONS OF LICENSE

1. Licensee may not reverse engineer, decompile, disassemble or otherwise reduce the binary object code Components to a humanly perceivable form for any purposes whatsoever, in whole or in part, except and only to the extent that it is expressly permitted by applicable law notwithstanding this limitation.

2. Some of the TurboCAD and SDK components include technology that is licensed by IMSI from Lightwork Design, Limited ("Lightwork") and from Spatial Technologies, Inc. ("Spatial"), as indicated in the "REDIST.TXT" file. IMSI offers no rights for use or distribution of such technology beyond those rights granted by the TurboCAD End-User License Agreement. Licensee must apply for separate licenses from Lightwork and Spatial in order to obtain rights to distribute components that include technology of IMSI's licensors. The Lightwork technology provides high-end radiosity and ray-traced 3D rendering, and the Spatial technology provides a mathematically specified, topological 3D solid geometry model. It is possible to build 3D applications without these sub-licensed technologies: IMSI-only technology contained in the SDK uses OpenGL rendering and a native 3D solid geometry model that give developers a basic platform for manipulating 3D geometry and materials.

3. Licensee agrees that Licensee will treat the Components of the SDK and any Derivative Works with the same degree of care as Licensee accord to Licensee’s own confidential information, which Licensee exercises reasonable care to protect. Licensee’s obligations under this section with respect to particular Components of the SDK shall terminate when Licensee can document that:

a. The Components were in the public domain at or subsequent to the time they were communicated to Licensee by IMSI through no fault of Licensee’s;

b. The Derivative Works were developed by Licensee’s employees or agents independently of and without reference to any information communicated to Licensee by IMSI; or

c. The communication was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the rights of either party under this Agreement.

4. Licensee agrees to protect IMSI's copyright and other ownership interests in all items in this SDK. Licensee agrees that all copies of items in this SDK reproduced for any reason by Licensee will contain the same copyright, trademark, and other proprietary notices as appropriate, as appear on or in the master items delivered by IMSI in this SDK. IMSI and/or its licensors retain title and ownership of the items in this SDK, the media on which it is recorded, and all subsequent copies, regardless of the form or media in or on which the original and other copies may exist. Except as stated herein, this Agreement does not grant Licensee any rights to patents, copyrights, trade secrets, trademarks or any other rights in respect to the items referred to by this Agreement.

5. Licensee agrees that any sale or distribution of products containing TurboCAD or SDK Components, or of products derived from them, shall carry with it a restriction that prohibits the purchaser or recipient from making any copies of the product. The sole exceptions will be copies required for backup purposes.

6. Licensee may not develop, integrate, market or resell products that use TurboCAD or SDK Components to become competitive with TurboCAD or the SDK. Competitive products may be defined as computer aided design ("CAD") or technical drawing products or products that CAD or technical drawing capability as part of their capabilities, that are intended for use by application developers or authoring product developers (in contrast to application users) to create applications with CAD or technical drawing capabilities. Products that offer an Application Programming Interface ("API") would typically be considered as belonging to this category.

7. Additionally, in order to avoid competitive situations where IMSI might compete with its own product, Licensee may not develop, integrate, market or resell environments that include the SDK in order to make the SDK's capabilities available to applications other than the Licensee’s Bundled Products. Relevant examples would be applications that perform as general purpose operating systems, general-purpose compilers or general-purpose plug-ins.

8. Licensee may not authorize Licensee’s customers or any third party to redistribute or sublicense the SDK or its copyrighted technology, except as specifically described within this Agreement. Reselling agreements for Licensee’s unmodified products (e.g. resellers and OEM's) are exempt from such restriction as long as proper license fees are paid.

9. Because IMSI distribution pricing is typically based on a per seat license fee, this Agreement, unless specifically noted herein, does not authorize Licensee to enter into unlimited distribution agreements with Licensee’s customers for use of the TurboCAD or SDK Components.

D. DISTRIBUTION AND PUBLICITY:

1. The TurboCAD and FloorPlan names are registered trademarks that are the sole and exclusive property of IMSI.

2. Licensee will acknowledge use of the SDK in the initialization screen or About Box and in online and printed documentation of any Bundled Products developed by Licensee, in a form similar to the following:

"CAD Technology copyrighted by International Microcomputer Software Corporation 1995-2002."

3. This License is specifically intended for use on individual client stations. It is not intended to cover any other usage, including, but not restricted to, server processing, concurrent processing, or unlimited use of any kind.

4. This License is limited to the distribution of the number of units of the SDK component named above. Additional distribution licenses are available at added cost.

5. Any direct or indirect distribution of any Bundled Products by Licensee shall be under the terms of an end user license agreement containing terms that:

a. Prohibit any modifications to the Derivative Works or any part thereof,

b. Prohibit any reverse engineering, disassembly or recompilation of the Derivative Works or any part thereof,

c. Disclaim any and all warranties on behalf of IMSI and each of its licensors,

d. Disclaim, to the extent permitted by applicable law, liability of IMSI and/or its licensors for any damages, whether direct, indirect, incidental or consequential, arising from the use of the Bundled Products,

e. Require the end user to comply fully with all relevant export laws and regulations of the United States to assure that the Bundled Products or any part thereof is not exported, directly or indirectly, in violation of United States law, and

f. Include the appropriate copyright notice.

5. IMSI may use Licensee’s name as a reference or in its advertising and publicity efforts.

E. UPDATES AND PRODUCT SUPPORT

1. Though SDK updates may be provided from time to time, unless agreed upon otherwise, they will be at added cost for either the SDK or for Distribution rights. Licensee understands that the purchase of SDK updates are separate from distribution license upgrades. Any license upgrades have to be purchased separately from SDK updates according to current price schedules. Upon purchase of an upgrade license, Licensee agrees to report the number of seats upgraded in addition to the number of new seats sold.

2. Licensee understands and agrees that IMSI may amend, modify, change, and cease distribution or production of TurboCAD or the SDK at any time. Licensee understands that Licensee is not entitled to receive any upgrades, updates, or future versions of the SDK under this Agreement.

F. REPORTING:

1. A distribution disclosure report plus appropriate licensing fees (if applicable) must be submitted to IMSI annually while any Bundled Products developed by the Licensee are shipping, or while any Bundled Products or Derivative Works are being used internally.

2. Reports are due no later than 30 (thirty) days after close of the current period, whether or not any license fees are due. If no seats have been used, it should be so noted.

3. If reports are more than 30 days late, access to technical support may be delayed until the report is received, in addition to other possible measures.

4. Reports not received for two consecutive reporting periods will be considered delinquent and will constitute a breach of this agreement. This agreement will terminate within 15 days of such delinquency, and Licensee will be obligated to cease and desist distributing Licensee’s product externally and internally, commercially and non-commercially with any IMSI Components.

G. US GOVERNMENT RESTRICTED RIGHTS

1. Use, duplication or disclosure by the United States Government is subject to restrictions as set forth under FARS 52.227-14, in FARS 52.227-19 or in DFARS 52.227-7013(c)(1)(ii) Commercial Computer Software - Restricted Rights.

H. ASSIGNMENT

1. This Agreement shall inure to the benefit of, and be binding upon, the parties hereto and their successors and legal heirs, but shall not be assignable by either party to any third party except with the prior written consent of the other party. Such consent will not be unreasonably withheld.

I. INDEMNIFICATION

1. Licensee agrees to indemnify, hold harmless, and defend IMSI from and against any claims or lawsuits, including attorneys' reasonable fees, that arise or result from the use or distribution of Bundled Products, provided that IMSI gives Licensee prompt written notice of any such claim, tenders to Licensee the defense or settlement of such a claim at Licensee’s expense and cooperates with Licensee, in defending or settling such claim.

J. TERM

1. This Agreement shall remain in effect until terminated. Licensee may terminate the Agreement at any time by ceasing to manufacture and distribute Derivative Works and Bundled Products of which the SDK is a component, and destroying all copies of the SDK Components.

2. The Agreement will also terminate upon Licensee’s failure to comply with the provisions of this Agreement, or in the event that Licensee becomes subject to any bankruptcy or insolvency proceeding under Federal or state statutes or becomes insolvent.

3. Upon any cause of termination, Licensee must cease to manufacture products of which the SDK is a component and must destroy all copies of the Product and all of its component parts.

4. Sections D.5 (Use of Licensee’s name) and H (Assignment) of this Agreement shall survive any termination. Upon termination of this Agreement, all fees or payments due IMSI by Licensee shall be immediately payable.

K. LIMITED WARRANTY

1. IMSI makes no warranty as to the operational performance of the SDK, the accuracy, completeness or usefulness of any information provided with this SDK, or the advisability of using the SDK in conducting Licensee’s business. The SDK is provided "as is" without warranty or representation, either express or implied, as to performance, merchantability or fitness for any particular purpose. The entire risk as to the quality and performance of the SDK is assumed by the licensee.

2. IMSI warrants that the diskettes/CD-ROM on which the Program is furnished will be free from defects in materials and workmanship under normal usage for a period of ninety (90) days from the date of original purchase. Licensee's sole and exclusive remedy in the event of a defect is expressly limited to the replacement of the diskettes/CD-ROM.

3. Because software is inherently complex and may not be completely free of errors, Licensee is advised to verify Licensee’s work and to make backup copies. In no event shall IMSI Software or anyone else who has been involved in the creation, production or delivery of this SDK be liable for any direct, indirect, special, incidental or consequential damages, such as, but not limited to, loss of anticipated profits, business interruption, benefits, use, or data resulting from the use of this SDK, or arising out of any breach of any warranty. Some states do not allow the exclusions or limitation of direct, incidental or consequential damages so the above limitation may not apply to Licensee.

L. CONSEQUENTIAL DAMAGES WAIVER

1. EXCEPT FOR A BREACH OF ANY LICENSE GRANT TO LICENSEE HEREUNDER OR UNDER THE AGREEMENT, IN NO EVENT SHALL EITHER PARTY BE LIABLE FOR ANY INDICENTAL, CONSEQUENTIAL, PUNITIVE OR SPECIAL DAMAGES, LOST PROFITS OR LOST DATA, OR ANY OTHER INDIRECT DAMAGES, EVEN IF SUCH PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

M. ACCEPTANCE

1. I AGREE AND ACCEPT THE TERMS OF THIS LICENSE:

Signature: _____________________________________________________________

Date: ________________

Name (please print): ___________________________________________________


REDIST.TXT

The following tables list the files that can be redistributed under different SDK license agreements. Please see the notes at the end of the tables for more information. Any files not listed in this table are not permitted to be redistributed unless specifically included under a separate license agreement.

Table 1. File List with File Type and Additional License Requirements

File Name | File Type | Additional License
\Program\CADGX.exe | COMPILED SAMPLE |
\Program\converter.exe | COMPILED SAMPLE |
\Program\Draggers\GearContour.dll | COMPILED SAMPLE |
\Program\Draggers\inetool.dll | COMPILED SAMPLE |
\Program\Draggers\InsertExternalSymbol.dll | COMPILED SAMPLE |
\Program\Draggers\inssmobj.dll | COMPILED SAMPLE |
\Program\Draggers\instool.dll | COMPILED SAMPLE |
\Program\Draggers\JointPolyline.dll | COMPILED SAMPLE |
\Program\Draggers\PlaneBool.dll | COMPILED SAMPLE |
\Program\Draggers\planeparameters.dll | COMPILED SAMPLE |
\Program\Draggers\tcfile.dll | COMPILED SAMPLE |
\Program\Draggers\TCPssWiz.dll | COMPILED SAMPLE |
\Program\Draggers\ToolSurvCoord.dll | COMPILED SAMPLE |
\Program\Draggers\tooltextalong.dll | COMPILED SAMPLE |
\Program\Events.exe | COMPILED SAMPLE |
\Program\filters\Jpeg.dll | COMPILED SAMPLE |
\Program\filters\MSEExport.dll | COMPILED SAMPLE |
\Program\JpegLib.dll | COMPILED SAMPLE | IJG
\Program\LTSample.exe | COMPILED SAMPLE |
\Program\MakeDwg.exe | COMPILED SAMPLE |
\Program\matrix.exe | COMPILED SAMPLE |
\Program\palettes\CustomPalette.dll | COMPILED SAMPLE |
\Program\Preview.exe | COMPILED SAMPLE |
\Program\PrintCAD.dll | COMPILED SAMPLE |
\Program\Regens\Bolt3D.dll | COMPILED SAMPLE |
\Program\Regens\BoltNut.dll | COMPILED SAMPLE |
\Program\Regens\Cable.dll | COMPILED SAMPLE |
\Program\Regens\Conn.dll | COMPILED SAMPLE |
\Program\Regens\CoordText.dll | COMPILED SAMPLE |
\Program\Regens\DatumRef.dll | COMPILED SAMPLE |
\Program\Regens\DatumTarget.dll | COMPILED SAMPLE |
\Program\Regens\Gear.dll | COMPILED SAMPLE |
\Program\Regens\Hole.dll | COMPILED SAMPLE |
\Program\Regens\MfcSplin.dll | COMPILED SAMPLE |
\Program\Regens\Nut.dll | COMPILED SAMPLE |
\Program\Regens\Nut3D.dll | COMPILED SAMPLE |
\Program\Regens\Roundrect.dll | COMPILED SAMPLE |
\Program\Regens\Rrect.dll | COMPILED SAMPLE |
\Program\Regens\RRectA.dll | COMPILED SAMPLE |
\Program\Regens\Screw.dll | COMPILED SAMPLE |
\Program\Regens\SurvCoordReg.dll | COMPILED SAMPLE |
\Program\Regens\TextAlong.dll | COMPILED SAMPLE |
\Program\Regens\TextBox.dll | COMPILED SAMPLE |
\Program\Regens\texture.dll | COMPILED SAMPLE |
\Program\sampleprint.exe | COMPILED SAMPLE |
\Program\SDKDemo.ocx | COMPILED SAMPLE |
\Program\TCADX.exe | COMPILED SAMPLE |
\Program\TCView.exe | COMPILED SAMPLE |
\Program\TcViewer.ocx | COMPILED SAMPLE |
\Program\Ties\CurveTextTie.dll | COMPILED SAMPLE |
\Program\Ties\RadDiaDimTie.dll | COMPILED SAMPLE |
\Program\Ties\SurvCoordTie.dll | COMPILED SAMPLE |
\Program\Ties\VertexTie.dll | COMPILED SAMPLE |
\Program\viewpict.dll | COMPILED SAMPLE |
\Program\GXExt80.dll | SDK CORE LIBRARY |
\Program\GXMPS80.dll | SDK CORE LIBRARY |
\Program\GXRenders80.dll | SDK CORE LIBRARY |
\Program\GXSurf80.dll | SDK CORE LIBRARY |
\Program\GXTIES80.dll | SDK CORE LIBRARY |
\Program\gxutil80.dll | SDK CORE LIBRARY |
\Program\Imsigx80.dll | SDK CORE LIBRARY |
\Program\FrontLine.exe | TURBOCAD APPLICATION |
\Program\frontopt.exe | TURBOCAD APPLICATION |
\Program\Tcw80.exe | TURBOCAD APPLICATION |
\Program\Aboutbox.dll | TURBOCAD CORE LIBRARY |
\Program\COMProperties.dll | TURBOCAD CORE LIBRARY |
\Program\Dbapi80.dll | TURBOCAD CORE LIBRARY |
\Program\dbtieapi.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\ACISdr80.dll | TURBOCAD CORE LIBRARY | SPATIAL
\Program\Draggers\Arc1dr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Arc2dr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Asstdr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\BoolDr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Cadedr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\CamDrag.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\CopyPrs.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Dblldr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Dimsdr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Griddr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\LightDrag.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Linedr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Loft80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Measdr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Meetdr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Miscdr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Nodedr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\PickInside.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Pntdra80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Se3ddr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Shelling80.dll | TURBOCAD CORE LIBRARY | SPATIAL
\Program\Draggers\SnapTool.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\sobjinsert.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Soldr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Textdr80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\VbaTool.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Walker80.dll | TURBOCAD CORE LIBRARY |
\Program\Draggers\Wpldr80.dll | TURBOCAD CORE LIBRARY |
\Program\filters\Acflt80.dll | TURBOCAD CORE LIBRARY |
\Program\filters\Sat80.dll | TURBOCAD CORE LIBRARY | SPATIAL
\Program\filters\Tcwflt80.dll | TURBOCAD CORE LIBRARY |
\Program\Geom80.dll | TURBOCAD CORE LIBRARY |
\Program\IMSIctrl.dll | TURBOCAD CORE LIBRARY |
\Program\Mats.dll | TURBOCAD CORE LIBRARY | LIGHTWORK
\Program\MatsApi.dll | TURBOCAD CORE LIBRARY | LIGHTWORK
\Program\Mscrol80.dll | TURBOCAD CORE LIBRARY |
\Program\Numerics.dll | TURBOCAD CORE LIBRARY |
\Program\OrgChart80.dll | TURBOCAD CORE LIBRARY |
\Program\PageSetup.dll | TURBOCAD CORE LIBRARY |
\Program\palettes\CalcPal.dll | TURBOCAD CORE LIBRARY |
\Program\Proppg80.dll | TURBOCAD CORE LIBRARY |
\Program\RCIQA.dll | TURBOCAD CORE LIBRARY | LIGHTWORK
\Program\RCore80.dll | TURBOCAD CORE LIBRARY | LIGHTWORK
\Program\Regens\DoorHouse.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\NorthDirection.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\TcAcis80.dll | TURBOCAD CORE LIBRARY | SPATIAL
\Program\Regens\tcbrsh80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\TCCamera.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\tccurv80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\tcdbl80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\tcdim80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\TCLight.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\Tcmlin80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\Tcplln80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\tcpnt80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\Tcregion80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\Tcsphr80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\Tctext80.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\Welding.dll | TURBOCAD CORE LIBRARY |
\Program\Regens\WindowHouse.dll | TURBOCAD CORE LIBRARY |
\Program\Renders\GlRender.dll | TURBOCAD CORE LIBRARY |
\Program\Renders\hiddenln.dll | TURBOCAD CORE LIBRARY |
\Program\Renders\lwRender.dll | TURBOCAD CORE LIBRARY | LIGHTWORK
\Program\Tc2Acis.dll | TURBOCAD CORE LIBRARY | SPATIAL
\Program\Tcapi80.dll | TURBOCAD CORE LIBRARY |
\Program\tcdb.dll | TURBOCAD CORE LIBRARY |
\Program\TCIntl80.dll | TURBOCAD CORE LIBRARY |
\Program\TcTools\PalTool.dll | TURBOCAD CORE LIBRARY |
\Program\tcwpro80.dll | TURBOCAD CORE LIBRARY |
\Program\Ties\ObjectTie.dll | TURBOCAD CORE LIBRARY |
\Program\Ties\SmartHatch.dll | TURBOCAD CORE LIBRARY |
\Program\Ties\ViewportTie.dll | TURBOCAD CORE LIBRARY |
\Program\vspell32.dll | TURBOCAD CORE LIBRARY | VCI
\Program\WebPubX.dll | TURBOCAD CORE LIBRARY |
\Program\Wintip80.dll | TURBOCAD CORE LIBRARY |
\Program\filters\3ds80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\bmpio80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Dgn80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Dwf80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Ehpgl80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Eps80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Fcw80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Flpln80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\jpgio80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Shx80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\tc20io80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Tcwflt80to70.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\Vrml80.dll | TURBOCAD FILTER LIBRARY |
\Program\filters\wmfio80.dll | TURBOCAD FILTER LIBRARY |

Table 2. File Types Permitted to be Redistributed By License Type

License Type | File Types Permitted
END-USER LICENSE | COMPILED SAMPLE
BASIC DEVELOPER LICENSE | COMPILED SAMPLE TURBOCAD CORE LIBRARY SDK CORE LIBRARY
FILTER DEVELOPER LICENSE | COMPILED SAMPLE TURBOCAD CORE LIBRARY TURBOCAD FILTER LIBRARY SDK CORE LIBRARY

NOTES

1. Any file types not listed in Table 2 above require separate agreements in order to be redistributed.

2. Any file with additional license requirements indicated in Table 1 ("SPATIAL", "LIGHTWORK", etc.) must also be covered by separate agreements, or comply with licensor's open source requirements, in order to be redistributed. Contact IMSI for further information.


TurboCAD SDK Overview

The TurboCAD SDK offers you a wide range of development choices to develop CAD and general-purpose graphics solutions. The SDK offers you the ability to exploit the 2D and 3D capabilities of TurboCAD through a simple programming interface, whether you're an individual TurboCAD user who wants to automate specific tasks within TurboCAD, or a developer who wants to build and sell third-party plug-ins.

You can program macros with the TurboCAD SDK using the Visual Basic for Applications development environment that ships with every copy of TurboCAD Professional. Create plug-ins with any other popular software development package that supports Microsoft's COM (Common Object Model) programming interfaces.

The SDK provides direct, object-oriented access to over 50 different objects that allow you to manipulate drawings and their contents, extract data and rendered bitmaps, and integrate CAD data with other systems. This overview will give you a brief idea of some of the ways you can use the SDK, as well as where to turn for more information.


Documentation Roadmap

The complete documentation for the TurboCAD SDK is broken into sections. Each section focuses on a particular area of knowledge, and provides a particular aspect of learning or using the SDK.

TurboCAD SDK Overview

This section contains a broad summary of the types of projects you can build with the SDK, gives a quick example of how to get started using Visual Basic for Applications, and provides references for sources of more information.

Exploring the TurboCAD SDK In Depth

This section covers the TurboCAD object model extensively, for the Visual Basic for Applications programmer. Each object is explained and many examples of using the objects for common tasks are given. For each example, whenever possible, the analog in the the TurboCAD user interface is provided.

Building Advanced Projects with the SDK

Some objects in the TurboCAD SDK cannot be used directly from Visual Basic for Applications, but require a third-party development environment such as Visual Basic or Visual C++. This section explains how to build add-ins and other projects that require external compilers.

Example Projects

This section describes the sample code projects that are shipped with the SDK, and provides brief instructions of how to build and install them.

TurboCAD Object Reference

This section is comprised of syntax, notes, and code samples for every object, method, property, event, and constant exposed by the TurboCAD SDK.

In addition to the Table of Contents that list each section, the documentation is indexed, and both the website version and HtmlHelp application versions of the documentation provide full text search.


Building Solutions with the TurboCAD SDK

TurboCAD integrates Microsoft Visual Basic For Applications (VBA), COM, and OLE Automation to allow developers to create custom projects to automate creation of CAD drawings, automate repetitive tasks, analyze CAD drawings, and import or export CAD data to any COM compliant application, such as those in the Microsoft Office family.

There are several ways to develop custom solutions using the TurboCAD SDK:

  • By operating within TurboCAD itself, by creating VBA macros in TurboCAD's VBA environment, or by writing scripts for HTML pages that can be run in TurboCAD's Internet Palette.
  • By running TurboCAD from an external application by referencing TurboCAD's object model, using either the VBA provided by that application, or using any development environment that supports binding to COM Automation servers (such as Windows Scripting Host, Internet Explorer's JScript, Visual Basic, or other products). You can launch the TurboCAD application and control it externally, or you can reuse the TurboCAD engine (.DLLs) and embed TurboCAD's functionality inside the external application.
  • By building new tools and add-ins to extend TurboCAD's functionality, using an external development environment that permits building COM server .DLL's (such as Visual Basic, Visual C++, or Delphi).


Writing VBA Macros

Generally speaking writing VBA macros is the fastest and simplest (hence, the most popular) way to develop custom solutions in TurboCAD. It is an integrated development environment allowing you to work simultaneously with both TurboCAD objects and VBA code.

Since the VBA IDE has its own debugger, developers can control creation of TurboCAD objects, their properties, behavior, etc. If any property or value needs modifying it can be done on-the-fly. It's also the easiest and quickest way to get familiar with TurboCAD's object hierarchy.

VBA macros are stored as VBA project files with the .TCM file extension and can be reused in other TurboCAD projects. You can create a macro to draw a floor plan using data from an Excel spreadsheet and vice versa, or you can create office room layouts using numeric and descriptive data stored in an MS Access database. Another example is writing macros to create fastners, widgits or any other object that one uses often. Instead of having to draw this frequently used object over and over again you can write your macro once and then run the VBA macro many times to create the objects.

Although VBA provides an extremely powerful and easy to use platform on which you can build significant solutions, you should be aware of a few limitations:

  • VBA code is interpreted each time you run a macro. Therefore the performance of your VBA project might be slower than desired, especially when you deal with complex objects and large calculations. By using compiled languages such as C++ you may be able to obtain better performance.
  • VBA macro projects (.TCM files) are always attached to a particular TurboCAD drawing and cannot be run from the Windows shell or command line without first loading the drawing. Using Visual Basic or another application shell can give you access to TurboCAD objects without requiring a predefined drawing.
  • VBA macro projects (.TCM files) tend to grow in size depending on the complexity of your TurboCAD project. Eventually you might end up with a rather large macro project file that might become even bigger than the TurboCAD drawing (.TCW file) you design your solution for.


A Simple VBA Example: Title Block

The TurboCAD SDK allows a developer to customize the creation of any CAD drawing by adding objects to a drawing, creating custom properties for objects, automatically specifying paper formats, drawing layouts, etc. Using the TurboCAD SDK developers can automate routine tasks such as adding frames and title boxes with drawing description, project name, author name, etc. to a drawing.

Let's say you need to create a technical drawing with certain standard formatting that includes paper size, frame, title block, and drawing data (scaling, author's name, etc.) Of course it is possible to draw all the above objects (rectangles, lines, text) in TurboCAD itself, yet if you need to reproduce the same formatting again and again in new drawings, this approach is clearly ineffective and time-consuming. A better way for such repetitive tasks would be to create a macro that can be added to a TurboCAD drawing whenever this particular formatting is needed.

In this example we will add an already written VBA project (TCM file) to a new drawing. The VBA project contains a macro that adds a frame with a simple title block to the drawing. You can obtain the TCM file for the TitleBlock project here. It can also be found in the Example Projects section of the documentation.

Adding a Macro Contained in an Existing VBA Project

Here are the steps required to create the new drawing, load the VBA project, and run the macro:

1. Open a new TurboCAD drawing by selecting New, New From Scratch from the File menu.

2. Open the Macros dialog box by selecting VBA Macro, Macros... from the Tools menu.

3. Replace the default project scope name (Project1) with a meaningful name for your macro project. We'll use the name TitleBlock. Type this name in the edit box on the Macros dialog box.

NOTE You can add as many macro projects to your drawing as needed, and each project can contain any number of individual macros. Each project and its contained macros is saved as one TCM file. After you have entered a new name for your macro project the Add... and New buttons become active.

4. Press the Add... button to add the TitleBlock project to the drawing.

5. In the File Open dialog box locate the VBA project file for this sample, named TitleBlock.TCM.

NOTE You can find all the SDK macro samples in the Macros directory. Click OK to attach the file as the TitleBlock VBA project. You should see the names of the available macros in the project, with the macro SetTitleBlock highlighted, as shown in this figure:

6. Press the Run button.

A frame with a simple title box in the right bottom corner will be added to your drawing, as shown in the accompanying figure.

Creating a New VBA Project

Creating a new VBA project is just as simple:

1. Type the name for your new macro project in the edit box of the Macros dialog box.

2. Press the New button to add the new project to the drawing.

3. Press the Editor button to start writing your macros.


Examining Title Block VBA Macro Sample Code

To see the code used in the VBA TitleBlock sample project, press the Editor button on the VBA Macro dialog, or select VBA, Visual Basic Editor from the Tools menu. This launches the VBA Editor application, which should appear on your desktop looking something like this:

NOTE: you have to add the TitleBlock sample project to the drawing in order to see the project when you open the Visual Basic Editor directly (by selecting VBA, Visual Basic Editor).

To see the macro code that draws the title block, scroll through the editor window. You should see the code listed as shown below:

Attribute VB_Name = "modTitleBlock"
Option Explicit

Sub SetTitleBlock()

'Code in this listing does several things:
'First, we get a reference to the active drawing object, then we set its
'drawing mode to Paper Space (Paper Space and Model Space will be discussed
'in Chapter 5), then we define paper size, calculate and draw border
'rectangle within defined paper space and margins, then draw the title box
'within the border rectangle (as a table), and then fill two cells of the
'title box table with simple text: "Design By" and "Project".

'Set up error handler
  On Error GoTo SetTitleBlock_Err

'Declare and set major TurboCAD objects
  Dim ActDr As Drawing
  Dim Grs As Graphics
  Dim Gr As Graphic
  Dim Vi As View

'Get active drawing object
  Set ActDr = ActiveDrawing

'Set active drawing space: Paper Space = 0, Model Space = 1
  ActDr.Properties("TileMode") = 0

'Get graphics collection of the active drawing
  Set Grs = ActDr.Graphics

'Set measurement units for the current drawing space to inches
  ActDr.Properties("PaperLinearUnitName") = "in"

'Declare variables to hold paper size data
  Dim PSetUp As PageSetup
  Dim SpaceUnits$, UnitScale#
  Dim PaperWidth#, PaperHeight#

'Read property (we set it to inches ealier in the code)
    SpaceUnits = ActDr.Properties("PaperLinearUnitName")

'Read paper size properties (we don't need to do that, it's just an illustration)
    Set PSetUp = ActDr.PageSetup
    PaperWidth = PSetUp.SheetWidth
    PaperHeight = PSetUp.SheetHeight

'Set paper size
    PaperWidth = 12#
    PaperHeight = 10#

'Define scaling rate depending on measurement units specified by user
'(in our case we programmtically set 'PaperLinearUnitName' to inches –
'see code above).We need to convert user measurement units to millimiters
'(TurboCAD's internal measurement units)
    If SpaceUnits = "mm" Then UnitScale = 1
    If SpaceUnits = "cm" Then UnitScale = 10
    If SpaceUnits = "m" Then UnitScale = 100
    If SpaceUnits = "in" Or SpaceUnits = """" Then UnitScale = 25.4
    If SpaceUnits = "ft" Or SpaceUnits = "'" Then UnitScale = 25.4 * 12

    PSetUp.SheetWidth = PaperWidth * UnitScale
    PSetUp.SheetHeight = PaperHeight * UnitScale

'Calculate rectangle for the frame based on defined paper size including margins
  Dim LeftMargin#, RightMargin#, TopMargin#, BottomMargin#
  Dim xLeft#, xRight#, yBottom#, yTop#
    LeftMargin = 1
    RightMargin = 0.5
    TopMargin = 0.5
    BottomMargin = 0.5

    xLeft = LeftMargin
    xRight = PaperWidth - RightMargin
    yBottom = BottomMargin
    yTop = PaperHeight - TopMargin

'Draw frame
    Set Gr = Grs.Add(imsiPolyline)
    With Gr.Vertices
        .Add xLeft, yBottom, 0
        .Add xRight, yBottom, 0
        .Add xRight, yTop, 0
        .Add xLeft, yTop, 0
        .AddClose
    End With
    Gr.Properties("PenWidth") = 0.01
    Gr.Draw

'Draw Title Box (as a table)
  Dim GrTable As Graphic
  Dim hTable#, wTable#
  Dim xL#, xR#, yB#, yT#, xMid#, yMid#

    hTable = 1
    wTable = 6

    xL = xRight - wTable
    xR = xL + wTable
    yB = yBottom
    yT = yB + hTable
    xMid = (xL + xR) / 2
    yMid = (yB + yT) / 2

    Set GrTable = Grs.Add(imsiPolyline)
    With GrTable.Vertices
        .Add xL, yB, 0
        .Add xR, yB, 0
        .Add xR, yT, 0
        .Add xL, yT, 0
        .Add xL, yB, 0
        .Add xL, yMid, 0, False
        .Add xR, yMid, 0
        .Add xMid, yB, 0, False
        .Add xMid, yT, 0
    End With
    GrTable.Properties("PenWidth") = 0.01
    GrTable.Draw

'Add text to table
  Dim GrText As Graphic
  Dim InputString$

    InputString = "Design By"
    Set GrText = Grs.AddText(InputString, (xL + xMid) / 2, yT, 0, hTable / 2, , , , 2)
    InputString = "Project"
    Set GrText = Grs.AddText(InputString, (xMid + xR) / 2, yT, 0, hTable / 2, , , , 2)

'Get actiev view of the active drawing…
  Set Vi = ActDr.Views(0)
'… and fit drawing to screen
  Vi.ZoomToExtents

SetTitleBlock_Exit:

'Destroy TurboCAD objects
    Set ActDr = Nothing
    Set Grs = Nothing
    Set PSetUp = Nothing
    Set Gr = Nothing
    Set GrTable = Nothing
    Set GrText = Nothing
    Set Vi = Nothing

    Exit Sub

SetTitleBlock_Err:
    If Err.Number <> 0 Then
       MsgBox "Error " & Err.Number & " in Sub 'SetTitleBlock'" & _
       vbLf & vbLf & Err.Description
       Resume SetTitleBlock_Exit
    End If
End Sub

This VBA code does several things: first, we get a reference to the active drawing object, then we set its drawing mode to Paper Space (Paper Space and Model Space are described in the In Depth section), then we define paper size, calculate and draw border rectangle within defined paper space and margins, then draw the title box within the border rectangle (as a table), and then fill two cells of the title box table with simple text: "Design By" and "Project".


Using Scripts in TurboCAD's Internet Palette

Besides using VBA to add enhancements to TurboCAD when its running, you can use the scripting capabilities of TurboCAD's Internet Palette. The Internet Palette allows developers to include VBScript and JavaScript to automate tasks as well as use other Internet-specific features in their solutions.

To use the Internet Palette in your custom TurboCAD solutions you must have Microsoft Internet Explorer installed on your computer. Internet Explorer provides a free development environment that gives you access to all of TurboCAD's objects in the context of a web page, with browsing, scripting, and HTML debugging capabilities. The VBScript engine in Internet Explorer uses a syntax very similar to that of Visual Basic for Applications.

Microsoft Scripting Technologies Pages

Here you can find information on JScript, VBScript and Windows Script Host that can also be used to build web pages that interface with the TurboCAD SDK.


Creating A Standalone Application

TurboCAD SDK is most typically used by a third party developer who wants to build a custom application that relies on the TurboCAD SDK's ability to load and view files and manipulate graphic data. The client can be written as a standalone application, a Java applet or component, or as an ActiveX control (OCX).

TurboCAD engine can be used in your application either in Local Server mode or in Inproc Server mode.

In Local Server mode TurboCAD runs as a full-blown application which makes available all TurboCAD interface (UI) and tools.

Local server sample link

Inproc Server mode exposes all TurboCAD mechanisms to load and display graphical files, render graphics, create graphical objects, etc. However TurboCAD engine does not provide objects to build user interface for your application. You will have to create your own program interface to manipulate TurboCAD objects and call its functions and tools.

Inproc server sample link

Inproc Server mode is most typically used to create ActiveX controls utilizing TurboCAD engine's functionality.

ActiveX sample link


Writing Custom Add-Ins

The TurboCAD SDK provides specialized program interfaces (APIs) to implement specific add-ins or extensions: custom objects, custom tools, custom file filters, custom ties, and custom palettes. These add-ins can let you build solutions that go beyond the capabilities of the standard TurboCAD engine. Here are some examples of the types of problems that can be solved with TurboCAD add-ins:

  • If you want to design parametrically controlled graphic objects, similar to those that come with TurboCAD, such as the Wall object, you can create a custom object (Regen).
  • If you have external data that you want to read into TurboCAD and display graphically, you can create your own custom file filter to do the job.
  • If you have a specific task you want to automate, you can create custom Tools that harness the power of TurboCAD's graphic engine, and integrate fully with the TurboCAD user interface.
  • If you need to maintain a specific link or relation between unrelated objects (such as associative dimensions), you can create a custom tie.
  • If you want to build a special user interface that needs its own window area, you can create a custom palette, that arranges your user interface in a docked window alongside TurboCAD's other palettes.

Add-Ins are OLE Automation servers, where the TurboCAD application (or the TurboCAD in-process server engine) is the client. An Add-In server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, necessary to support the functionality they provide.

See Creating Advanced Projects with the TurboCAD SDK for more information on this interface.

Add-In extensions are loaded when TurboCAD starts up. To be successfully loaded, an Add-In extension file (a module with a .DLL, .EXE., or .VBP extension) must be located in the Regens, Draggers , Filters, Ties, or Palettes subdirectory of the server. Each module in this directory is queried for a type library (or an alternative method for Delphi) that tells TurboCAD what extensions are served by the module. Then the module's automation object(s) are created.

On initialization, the Add-In server tells TurboCAD information on itself depending on the Add-In type. Later, TurboCAD will call on the Add-In server to perform certain actions depending on the Add-In type (see the various custom add-Ins later in this section). For instance, TurboCAD will ask the Custom Object Add-In server to "regen" (regenerate) its graphics when they have been modified by users. This regeneration process allows the Custom Object to maintain its graphics using its own logic.


Creating Custom Objects

Custom Objects are a means of parameterizing common elements in a drawing. By Custom Object we mean an external description of an object and its properties that are read by TurboCAD and transformed into a graphical on-screen representation. Suppose we have a description of a coil spring that is described by the following parameters: number of active coils, spring diameter, wire diameter, pitch, etc. Using this formal description we can create both 2D and 3D images whose actual on-screen representation will vary each time we change one or more parameters in this description.

Typically a Custom Object is a DLL placed into the Regens folder and loaded as TurboCAD loads at startup. However you can design, test, and debug your Custom Object using the VBA integrated development environment provided by the TurboCAD SDK. When you are satisfied with the results you can create a DLL project using VB 6.0 by copying most of your VBA code into the VB 6.0 DLL project.

The same result (Custom Object functionality) can be achieved by writing a VBA macro directly in a TurboCAD drawing, yet in this case each time you change the object's properties you need to remove the previously created object, create a new one and position it to specific coordinates in the drawing, whereas the Custom Object preserves its coordinates in the drawing.


Creating Custom Tools

Custom Objects are a means of object parameterization and Custom Tools are a way to allow object creation and analysis.

For instance, the TurboCAD user interface provides a button to create a circle, yet it has no button to let you create and display a custom object that you have designed. Custom Tools are the way to provide this functionality: it may include buttons to create Custom Objects, other user interface elements, data input fields, local menus etc.

It is also possible to use Custom Tools to analyze, modify, and manipulate already created objects. For instance, Custom Tools can be used to calculate objects areas, volumes of selected 3D objects, Boolean operations on objects, etc.


Creating Custom Filters

Custom File Filters provide a means to exchange data between applications. Filters are extension objects that TurboCAD uses to read graphic information from disk into the current drawing, or to save the current drawing to disk.

The TurboCAD SDK provides several ways to implement data exchange between applications: VBA macros, Custom Objects, and Custom Tools. However the most common way to handle data exchange between applications would be to create a Custom File Filter.

You write filters when you need to read data from a file that is not included in the file types natively understood by TurboCAD (the file type is not shown among available file types in the File Open dialog box). In other words, TurboCAD does not support this type of file (for example, TurboCAD's File Open menu cannot open text files, Excel spreadsheets, CSV files, etc.).

Imagine you have a text file containing coordinates for a number of points comprising a geometrical figure. What you'd like to do is read this data into TurboCAD and have TurboCAD draw this geometrical figure for you in the drawing. This is a typical Custom File Filter task. You need to write a procedure to read textual data from a file and create corresponding geometry in a TurboCAD drawing according to a certain algorithm.

Once you have written your filter and added it to the TurboCAD Filters folder it will be available for use in TurboCAD. The Custom File Filter will be added to the list of file types understood by TurboCAD in File Open, Files Save, and File Save As dialog boxes depending on the filter type (data export or import).

There are two major ways to implement a Custom File Filter: through OLE Automation (by opening the host application to read a file created in that application) or through byte-by-byte reading of data from the file. These two approaches can be used to create Custom File Filters for saving TurboCAD drawings as file types not native to TurboCAD (.TXT, .CSV, .XLS, etc.) also.


Creating Custom Ties

Like Custom Objects a Custom Tie is a means to create a parameterized object. By 'tie' we mean some user-defined graphical relationship assigned to one or more intrinsic TurboCAD objects.

For example we have two lines drawn in a TurboCAD project. We can programmatically assign to both lines a certain relationship (e.g. coincidence and perpendicularity ties between the two lines). This means that if we modify one of the lines the other one will respond according to our pre-defined relationship (tie). In this example the angle between the lines will always be 90 degrees.

Custom Ties between objects is not only a geometrical relationship. Tie can mean any relationship between TurboCAD objects where modifying one object causes user-defined changes (geometry, properties) in the other 'tied' objects.


Creating Custom Palettes

Custom Palettes are very similar to Custom Tools (i.e. they provide similar functionality). The difference between the two is that a Custom Tool is a button on the TurboCAD toolbar whereas a Custom Palette has its own window (a docking palette similar to the standard TurboCAD palettes) with its own UI. Custom Palettes use a simplified programming interface to connect to the TurboCAD engine.


Other TurboCAD SDK and VBA Programming Resources

Other places you can obtain information on VBA programming in general, and on TurboCAD SDK programming in particular, include the following:

TurboCAD Professional v8 and VBA Forum

You can also read or contribute to the TurboCAD for Windows : SDK Forum (C++, VB, Delphi and Java) Forum, if your focus is on programming with these external compilers.

TurboCAD SDK Programmer's Gallery

This is a proposed area for third party developers to share source code and compiled projects. Send us any submissions you'd like to see posted.

Previous Versions of SDK Documentation

Older documentation can be found here.

Microsoft VBA Pages

Microsoft provides a wealth of information about VBA for developers and end users on their website.

Microsoft Scripting Technologies Pages

Here you can find information on JScript, VBScript and Windows Script Host that can also be used to build web pages that interface with the TurboCAD SDK.

Books on VBA

Here is a short list of recommended reading, with links to Amazon.com, if the listed books are available for purchase. Fatbrain.com is another good online supplier of computer books.

VB and VBA in a Nutshell: The Languages
By Paul Lomax, Ron Petrusha (Editor), ISBN 1565923588

Developing Solutions With Office 2000 Components and VBA
By Peter G. Aitken, ISBN 0130263052

Of course, we welcome your recommendations. Please let us know if you have found any books, websites or other sources especially useful.


Exploring the SDK in Depth

This section provides an exploration of all the objects exposed in the SDK that you can use to create programs using Visual Basic for Applications. Each object is introduced and examples of solutions that can be built with the object are presented, followed by a survey of the detailed operations that the object supports.


Understanding the TurboCAD Object Model

An object is the main building block of the TurboCAD interface. Each exposed object represents a certain part of TurboCAD engine and can be programmatically accessed and manipulated to control its behavior. Objects are combined into collections. There are many different types of objects in the TurboCAD interface. For example:

  • All on-screen geometry is implemented through use of Graphic object
  • Organizational structures such as layers and blocks are objects
  • Drawing display is represented by View object and Views collection
  • The drawing itself and the TurboCAD application are objects

To create macros in TurboCAD VBA or to build applications or servers that use the TurboCAD engine, you need to write programming statements that tell the engine what you want to do. The functionality in the TurboCAD engine that you control is exposed by programmable objects, composed and organized in a hierarchical object model.

Before you can begin building macros and other programs with the TurboCAD SDK, it's important to understand the variety of objects within the TurboCAD object model, and the common ways you can perform basic tasks using these objects. The objects are structured in a hierarchical fashion, with the Application object at the root. The view of this hierarchical structure is referred to as the Object Model. The Object Model shows you which object provides access to the next level of objects.

This diagram gives an indication of the hierarchical organization of the model:

Application object
Filters collection (Filter object)
NamedColors collection (NamedColor object)
Properties collection (Property object)
RegenMethods collection (RegenMethod object)
Renders collection (Render object)
TieMethods collection (TieMethod object)
Tools collection (Tool object)
Drawings collection (Drawing object)

Graphic object
Block object
BoundingBox object
BrushStyle object
LineStyle object
Matrix object
Properties collection (Property object)
Vertices collection (Vertex object)
Graphics collection (Graphic object)

Object
Collection

Blocks collection (Block object)
Graphics collection (Graphic object)
BrushStyles collection (BrushStyle object)
BrushPatterns collection (BrushPattern object)
GraphicSets collection (GraphicSet object)

Layers collection (Layer object)

LineStyles collection (LineStyle object)
Macros collection (Macro object)

NamedViews collection (NamedView object)
PaperSpaces collection (PaperSpace object)
Graphics collection (Graphic object)
Properties collection (Property object)
Properties collection (Property object)

TieSets collection (TieSet object)
Ties collection (Tie object)
Views collection (View object)

Graphics collection (Graphic object)

Objects within the model are interrelated. These relationships of access and containment are illustrated in the diagram by lines connecting the object type names. Some objects, called collections, hold groups of child objects, establishing a hierarchy; access to the child objects is often controlled by the parent collection. All collections in the object model expose standard ways of adding, removing, and accessing child objects.

Each object you work with is an instance of an object type. An object type exposes properties, which represent the modifiable state of an object; and methods, which are procedures that you can use to create new objects, destroy existing objects, or change an object's state. The largest part of the documentation of the TurboCAD SDK will explain in detail what these types, methods and properties are.

After discussing the basics of how you start using the objects contained in the TurboCAD object model, the documentation text will explain commonalities that are shared between different types in the object model, and how to navigate along the lines of the object model hierarchy. Other sections of the documentation will help you learn about specific properties and methods that you can use on the most important object types. The reference section of the documentation explains in detail the syntax and behavior of all the objects, methods and properties in the model.


Referencing the TurboCAD Type Library

The description of TurboCAD's objects, methods, and properties are packaged in a machine-readable file called a type library, embedded within the DLLs distributed with the TurboCAD SDK. The location of this type library is registered within the Windows Registry when you install TurboCAD or the TurboCAD SDK. The type library explains to programming development systems such as Microsoft Visual Basic, Microsoft Visual Basic for Applications, and Java the proper syntax for building machine code that uses TurboCAD objects. Before you can begin to use TurboCAD objects, you must establish a "reference" to the TurboCAD type library within the development system you are using. The process for creating this reference varies from one system to another.

Visual Basic and Visual Basic for Applications

If you're using VBA within TurboCAD, this reference is already established for you. If you're programming in Visual Basic or using another application's VBA to access the TurboCAD engine, you must explicitly add the reference. To add the TurboCAD type library:

  • Start the Visual Basic Editor.
  • Open the References dialog box using the Tools, References... menu item.
  • Check the TurboCAD v4.1 Programmable Objects item in the Available References list box, as shown in the figure.
  • Press the OK button to confirm the reference.

Visual C++

If you're using Microsoft Visual C++, you can make a reference to TurboCAD by using the #import statement in your header files. The type library is contained in IMSIGX70.DLL, so a typical project will contain a statement like:

#import "C:\Program Files\IMSI\TCWP71\Program\IMSIGX70.DLL" raw_interfaces_only, raw_native_types, no_namespace, named_guids

After importing the type library, you can use Visual C++'s smart pointers to access the TurboCAD SDK's objects and interfaces. See the Visual C++ documentation for more details.


Using TurboCAD Objects in Visual Basic and Visual Basic for Applications

Once the TurboCAD type library has been referenced you can begin using the objects in the TurboCAD SDK. The following discussion is limited to Visual Basic and VBA; for other development systems, consult their documentation. TurboCAD objects are contained within a namespace defined by the name of the type library ("IMSIGX"), in order to prevent confusion between similarly named objects defined by different applications. VB and VBA allow you to use this namespace optionally, as long as the names for TurboCAD's objects don't conflict with those contained in other type libraries referenced in your VB/VBA project.

Browsing TurboCAD Objects

You can see the list of available TurboCAD objects by opening the VB/VBA Object Browser.

explain procedure

If you choose "IMSIGX" as the name in the Library combo box, the Object Browser will list only the TurboCAD objects and constants in the Object pane. The Browser will look something like this:

insert figure here

Declaring A TurboCAD Object Variable

You can also use the IMSIGX namespace to limit Visual Basic's Intellisense feature to show you possible object types when you are typing in the Visual Basic code editor. To use the TurboCAD Application object, for example, you can declare a variable as a TurboCAD object type by writing code such as the following:

Dim app As IMSIGX.Application

Try typing this statement in the editor, and notice that when you finish typing "IMSIGX.", Intellisense will pop up a list of TurboCAD objects, and allow you to select one to complete the word. The entire statement declares the variable named app as a TurboCAD Application object type. Note that we have "qualified" the Application object type by the use of TurboCAD's library name: IMSIGX. Of course you can omit the IMSIGX qualifier and achieve the same result. Try typing this:

Dim app As Application

In either case, you have declared the variable to be able to hold a reference to the TurboCAD Application object.

Obtaining and Setting Object Variable References

Now you're ready to actually use the Application variable you have declared. This is accomplished by using the Visual Basic Set statement. There are a number of ways to obtain object references. Here is one way:

Set app = Application

The TurboCAD SDK exposes a number of global methods and properties. The Application global property returns a reference to the currently running Application object. Note that you must use the Set statement to assign references to object variables; otherwise Visual Basic will report a run-time error.

Set app = New Application

This is the standard way to create new objects. If you were working in Visual Basic, this statement would result in the launch of a new instance of the TurboCAD application. You use the New statement with the name of a creatable object type. Not all objects can be created this way. In the documentation, you will see occasions where objects are referred to as "standalone". In most cases these standalone objects can be created from scratch using the New statement.

Set app = CreateObject(, "TurboCAD.Application")

This statement has the same effect as the previous one. The CreateObject Visual Basic function also allows you to specify the server on which TurboCAD will be launched. Consult the Visual Basic documentation to find out more about using this function.

Set app = GetObject(, "TurboCAD.Application")

This Set statement assigns a reference to the currently running instance of TurboCAD, by using the GetObject function. Once you have an Application object, you can obtain references to other objects in the object model.

Dim dwg As Drawing
Set dwg = app.ActiveDrawing

In this case you are using the ActiveDrawing property on the Application object to obtain a reference to a Drawing object. Since the ActiveDrawing property is also a global property (as are many of the properties exposed by the Application object), you could have also written:

Set dwg = ActiveDrawing

to accomplish the same thing. Many of the examples contained in the documentation will make use of the ActiveDrawing global property.


Using TurboCAD Objects and Other Type Library Objects

Because of the optional nature of the IMSIGX namespace when using TurboCAD VBA, you can write either of the two statements

Dim app As IMSIGX.Application

or

Dim app As Application

to declare a TurboCAD Application object variable. However, declaring a bare, unqualified Application object variable in another VBA application, such as Microsoft Excel, will cause VBA to use that application's type library, not TurboCAD's.

Insert example of using Excel object


Using TurboCAD Objects and Collections

Once you have declared a variable that can hold a TurboCAD object, and assigned an object to the variable using the Set statement, you can use the properties and methods that the object exposes.

Using Object Properties

Dim bVisible As Boolean
bVisible = app.Visible
app.Visible = Not bVisible

With this bit of code, you can access and modify the Visible property of the Application object stored in the variable named app. Note that because the Visible property is not an object type, but a built-in Visual Basic type (Boolean), you don't need to use the Set statement to assign its value.

Using Object Methods

In addition to getting and setting the values of properties, objects expose methods that perform operations. You use the same type of syntax as with properties. For example, to quit the running application:

app.Quit

Methods can return values:

Dim filename As String
filename = app.GetOpenFileName

Using the With Statement and Objects

The performance and readability of a block of code that accesses an object's methods and properties can be enhanced when you use the Visual Basic With and End With statements. Inside the block of code defined by these statements, you can omit the variable name and refer to the object's methods and properties with an abbrieviated syntax:

With ActiveDrawing
       Debug.Print "Drawing " & .Name & " has " & .Graphics.Count & " graphics"
       Debug.Print "Drawing " & .Name & " has " & .Graphics.Count & " graphics"
End With

Most of the code samples you will find in the SDK use the With statement.

The Default Method or Property

Some object types have a default method or property that allows you to shortcut some of the normal syntax. For example, TurboCAD collections expose an Item method that lets you select an object from the containing collection. Because Item is the default method for the Properties collection, either of the following two statements is equivalent:

Dim prop As Property
Set prop = app.Properties.Item(0)

Dim prop As Property
Set prop = app.Properties(0)

Another place you can use this shortcut is the Property object's (default) Value property. To find out what the Value of a Property object is, either of these bits of code is equivalent:

Dim val As Variant
Set prop = app.Properties.Item("UndoBuffers")
val = prop.Value

Dim val As Variant
Set prop = app.Properties("UndoBuffers")
val = prop

Choosing which syntax to use is just a matter of style.


Objects and Collections

Many of the object types in TurboCAD's object model are collections. Collections are just a special kind of object type that are used as containers for other objects. The objects are held in the collection in the form of a numbered, indexed list. You can walk through this list to find all the objects in the collection, or retrieve a particular object based on its numbered index. In addition most collections support retrieving objects based on a name, as well as an index number.

In the object model diagram collections are indicated by a light blue color. These types expose standard properties and methods to enumerate and access objects contained in the collection.


Performing Common Operations on Collection Objects

Since collection objects are commonly used to move through the object model, there are standard methods and properties provided by all collection types.

Finding Out How Many Items Are in a Collection

You use the Count readonly property of a collection to find out how many items the collection contains:

Dim c As Long
c = app.Properties.Count

Selecting an Item in a Collection by Index

Items in a TurboCAD collection are indexed, starting from zero for the first item in the collection. The last item in the collection has an index value one less than the number obtained from the collection's Count property. You use the (default) Item method of a collection to select an indexed item. For example, to list all the items in a collection, you can write code such as the following:

Dim i As Long
For i = 0 to  c - 1
    Debug.Print app.Properties.Item(i).Name
    'or Debug.Print app.Properties(i).Name
Next

Selecting an Item in a Collection by Name

Most items contained in TurboCAD collections have a Name property that identifies the item. In these cases, you can also pass the name of the item you want to select as the argument to the collection's Item method:

Set prop = app.Properties.Item("UndoBuffers")
'or Set prop = app.Properties("UndoBuffers")
Debug.Print prop.Name 'prints "UndoBuffers"

Using the For Each…In Statement to Enumerate All of a Collection's Contents

Visual Basic's For Each…In Statement allows to you to enumerate all the items in a collection, setting the reference to the item each time the loop is entered:

For Each prop In app.Properties
Debug.Print prop.Name
Next

Adding an Item to a Collection (Creating a New Item)

Most collections support adding or removing items. Each collection usually has a method named Add that allows you to add an item. Some collections maintain complete ownership over the items they contain. In these cases, the Add method actually creates the item, and then adds it to the collection. The parameters for each of these collection's Add method will vary according to the information necessary to create the collection's contained item type. The Add method that creates a new item will usually return a reference to the newly created and added item, ready for your use.

Set dwg = app.Drawings.Add("NewDrawing")

Adding an Existing Item to a Collection

Some collections allow you to add items that exist outside the collection. In this case, the Add method (or a method with a name that begins with "Add") will take a reference to the existing item as a parameter, and will have no return value. If you want the collection to have complete ownership of the item, you should release the outside reference to the item after you add it, by setting the variable to the empty reference "Nothing".

Set gr = New Graphic 'create a standalone graphic
ActiveDrawing.Graphics.AddGraphic(gr) 'now part of Graphics collection
Set gr = Nothing 'release outside reference

Removing an Item from a Collection (Deleting the Item)

For collections that completely control the existence of their contents, the standard way to remove an item from the collection is to obtain the item, and then call the item's Delete method (for some item types, such as the Drawing object, this method might have another name, such as Close). This will destroy the item and remove it from the collection:

c = app.Drawings.Count 'current size of collection
If c > 0 Then
  Set dwg = app.Drawings(0) 'obtain the item
  dwg.Close 'delete the object
  Set dwg = Nothing 'the dwg variable is now useless
  c = app.Drawings.Count 'now it's one less than before the Close!
End If

Removing an Item from a Collection (Retaking Ownership)

In cases where collections don't completely control the lifetime of their contents, you can remove an item from the collection and let it survive outside the collection by using the collection's Remove method. This takes the same parameters as the Item method, and returns the newly liberated item:

c = ActiveDrawing.Graphics.Count 'current size of collection
If c > 0 Then
  Set gr = ActiveDrawing.Graphics.Remove(c - 1) 'obtain the last item
  'gr is now free from the collection, we can use it or release it
  Set gr = Nothing 'released and destroyed!
  c = ActiveDrawing.Graphics.Count 'now it's one less than before the Close!
End If


Navigating through the Object Hierarchy

If you look at the object model diagram, you will see lines connecting the names of the object and collection types. These lines represent the paths by which you can move up and down the hierarchy of containment. For example, the Application object contains a collection called Drawings, which you obtain by accessing the Application's Drawings property. Then, to locate a particular Drawing within the Application, you can use the Drawings collection's standard Item property, supplying either an integral argument (representing the numbered index, starting with zero, within the collection), or a String argument (representing the name of the Drawing):

Dim app As Application
Dim dwgs As Drawings
Dim dwg As Drawing
Set app = Application
Set dwgs = app.Drawings
Set dwg = dwgs(0)
Set dwg = dwgs("Drawing1")

This is an example of traversing down the object hierarchy. Most object types support the standard Parent and Application properties for traversing up the hierarchy also:

Set app = dwg.Application
Set app = dwg.Parent

By referring to the object model diagram, you can discover the most common methods of accessing one type of object given another.


Understanding Standard, Extended, and Custom Object Properties

While all object types expose built-in, browseable properties for the use of the programmer, some TurboCAD objects (the Application, Drawing, and Graphic objects) also have properties that are not visible to the Visual Basic Object Browser, because they are not encoded in the TurboCAD type library. Since TurboCAD is a dynamic, extensible system, these properties may differ from one release or installation to the next. These properties are accessed through a special collection type, appropriately enough, Properties, and can be discovered and used at run-time, as will be discussed in the following sections.

To distinguish between these two different systems of property use, we will use the term "standard" to mean the browseable unvarying properties that are encoded in the TurboCAD type library, and the term "extended" to refer to those properties that are accessed by use of the Properties collection.

Because CAD drawings often need to associate additional data with particular elements contained within them, TurboCAD allows you to create your own extended properties and attach them to TurboCAD's Graphic objects. We will use the term "custom" property to refer to an extended property that is supplied by the application programmer, and is not part of the TurboCAD system.


Using Standard Properties

Standard properties can be discovered by using the Object Browser, or by the Intellisense feature built into the Visual Basic Editor.

Insert figure here

If you open the Object Browser and select a TurboCAD object in the object pane, you will see the names of the object's standard properties listed in the property pane (indicated by the property icon). Clicking on a property name causes the type and help string associated with the property to be listed in the information pane below.

When you type the object name and a dot in the Visual Basic Editor, Intellisense will pop up a list of the object's methods and standard properties, allowing you to complete the expression by pressing the Tab key. Standard properties are the easiest to access, but are limited to the most commonly used properties of an object. Since TurboCAD is an extensible system, the SDK provides a mechanism for adding more properties to an object: Extended and Custom properties.


Extended and Custom Properties: Using the Properties Collection

To access the extended and custom properties for an object, you must use the Properties object exposed by the object. Since the Properties object is a true collection, you can use standard ways to find and locate individual properties, such as the Visual Basic For Each..In statement.

Dim props As Properties
Dim prop As Property
Set props = app.Properties
For Each prop in props
    Debug.Print prop.Name
Next

If you know the name of the extended or custom property you can access it through the Properties collection's (default) Item property:

Set prop = app.Properties.Item("AutoSave")

or, equivalently, using the fact that Item is the default property for the Properties collection:

Set prop = app.Properties("AutoSave")


Using the Property Object

The objects contained in the Properties collection are Property objects. Each extended or custom Property object has a Name, Type, and Value standard property exposed. You can query both extended and custom properties for these:

Debug.Print "The name of the AutoSave property is " & prop.Name
Debug.Print "The type of the AutoSave property is " & prop.Type
Debug.Print "The current value of the AutoSave property is " & prop.Value

The Name and Type of extended and custom properties are always read-only. The Value may or may not be changed, depending on the individual property. The values returned in a Property object's Type property are the same as those returned by Visual Basic's VarType function. Some properties are stored as array types, and require special handling.

See the modProperties.bas sample module for recommended ways to discover Property object information.

NOTE Although an extended property may be attached to an object, it is possible that the property may be undefined. In this case, the Type and Value properties of the Property object will return errors. Make sure to include error handling code when dealing with extended properties.


The Application Object

Application object is the root of TurboCAD object model. By creating an object variable pointing to TurboCAD Application object you initialize TurboCAD engine to do some work for you. You can create new or open existing drawings, create and modify graphical objects in TurboCAD drawings, read and set objects' properties, etc.

For instance, setting a reference to an active drawing using the Application object's ActiveDrawing property is the easiest way to manipulate an open drawing programmatically since a VBA macro is always executed in an active drawing. For details on using Drawing object's properties and methods see The Drawing Object section.

Many of the Application's methods and properties are also exposed as global methods and properties, so you don't always need to specify the Application object or declare an Application variable to use them. In addition, the Application property (both a global property and a property of the Application object itself) allows you to get an immediate reference to the Application:

Debug.Print Application.Drawings.Count

There are actually two kinds of Application object: one of them is responsible for creation of TurboCAD application, i.e. it starts TurboCAD as self-standing application (out-of-process server), while the other is responsible for creation of TurboCAD as in-process server. To learn more about using the different flavors of Application for standalone projects that use TurboCAD either as an in-process or out-of-process server, see the Advanced Topics section of the documentation.


What's in an Application?

The Application object exposes as number of properties and methods that allow to access and manipulate behavior of TurboCAD engine. The below list shows the most typically used properties and methods of the Application object:

Application Standard Properties
Property | Description
ActiveDrawing | Returns the active Drawing object, i.e. a currently opened TurboCAD drawing.
Application | Returns a self-reference to the object. Since this is exposed as a global property, you can use this property to get a reference to the currently running application instance in VBA, without using New, CreateObject, or GetObject.
Build | Read-Only. Returns the TurboCAD application build number as a string.
Drawings | Returns the Application object's Drawings collection, i.e. all currently opened TurboCAD drawings including the active drawing.
Filters | Returns the Application object's Filters collection, i.e. the collection of Filter objects.
Name | Read-Only. Returns the name of the TurboCAD Application object as string.
NamedColors | Returns the Application object's NamedColors collection, i.e. the collection of NamedColor objects.
Path | Read-Only. Returns a string containing complete path to the folder where TurboCAD executables are installed (without the final separator), e.g. 'C:\Program Files\IMSI\TCWP70\Program'.
Properties | Returns the Application object's Extended Properties collection (see below).
RegenMethods | Returns the Application object's RegenMethods collection.
TieMethods | Returns the Application object's TieMethods collection.
Renders | Returns the Application object's Renders collection.
Selection | Returns the Selection collection of the active Drawing object, i.e. all currently selected graphic objects.
SnapModes | Returns and sets active Snap Modes.
Visible | Returns or sets TurboCAD application Visible property. TRUE if the application's main window is visible.

Application Extended Properties
Property | Description
UndoBuffers | Specifies the maximum number of user actions to be saved in Undo buffer to enable user undo as many last actions as specified by this number.
PaperColor | Specifies color of the paper sheet in paper Space Mode.
BackgroundColor | Specifies TurboCAD workspace color in Paper Space mode.
ZoomFactor | Allows to increase/decrease current project zoom. Same as pressing Zoom button on the toolbar.
PromptForSummaryInfo | Specifies whether to prompt user for project summary info when saving a TurboCAD project file.
AutoSaveOption | Turns on and off TurboCAD AutoSave feature. If set to TRUE (AutoSave on) then open project will be saved every X minutes, where X is the AutoSave property setting (see below).
AutoSave | Specifies time interval in minutes for the AutoSave feature (works in combination with AutoSaveOption property when AutoSaveOption property is set to TRUE).
GeometricExtents | Specifies selection mode for individual graphics in a drawing: 0 - whole object must be within selection, 1 = selecting any part of an object selects the whole object.
SnapMode | Defines mouse click behavior, i.e. sets a certain relationship between mouse click and an object in a drawing.
Aperture | Specifies area around mouse click (in pixels) where nearest object is sought.
$DEFAULTFONT | Sets default font for text in TurboCAD drawings.

The Application object exposes methods that allow you to perform application-scope activities (tasks that don't require a drawing, or that are persistent from one TurboCAD session to the next):

Application Methods
Method | Description
GetOpenFilename | Displays a standard Windows Open File dialog box without actually opening any file. Returns full path and name of selected file(s) as string.
GetSaveAsFilename | Displays standard Windows Save As dialog box without actually saving any files. Returns a filename entered by user as string.
Quit | Quits the application. Does not run any OnClose macros before exiting.
ConnectEvents | Connects TurboCAD Application object events sink. Set the mask parameter to only receive a subset of the full event set.
DisconnectEvents | Disconnects an ApplicationEvents object sink.

The Application object in out-of-process server mode fires events at predetermined times. You can write subroutines, called event handlers, that receive notification when these events are fired, allowing you to perform tasks when users interact with TurboCAD. Below is the list of the most typically used events fired by the TurboCAD Application object:

Application Events
Event | Description
BeforeExit | This event is fired before the Application object is destroyed.
DrawingNew | This event is fired after a new Drawing object has been created.
DrawingOpen | This event is fired after an existing Drawing object, i.e. drawing file, has been opened.
DrawingActivate | This event is fired when a drawing receives the focus and becomes the active window.
DrawingDeactivate | This event is fired when a drawing loses focus.
DrawingBeforeClose | This event is fired before a Drawing object is closed.
DrawingBeforeSave | This event is fired before a Drawing object is saved.
DrawingAfterSave | This event is fired after a Drawing object has been saved.
MouseDown | This event is fired when a mouse button is pressed.
MouseUp | This event is fired when a mouse button is released.
MouseMove | This event is fired when mouse is moved.
BeforeDoubleClick | This event is fired when left mouse button is double clicked yet prior to any TurboCAD processing of this event.
BeforeRightClick | This event is fired when left mouse button is double clicked yet prior to any TurboCAD processing of this event.
SelectionChange | This event is fired when selection changes, i.e. when user selects or deselects an object.
RunTool | This event is fired when a Tool object is activated, i.e. when a tool is selected in TurboCAD toolbar.
Drop | This event is fired after some object has been dropped into a drawing.


Accessing the Application Object

If you develop a project using TurboCAD Visual Basic for Applications you don't have to create the Application object: it exists implicitly in all TurboCAD projects. You can access its standard properties and methods using the global Application property:

Debug.Print Application.Name

or set up a variable to hold the application, if you're going to use many Application methods or properties in a subroutine:

Dim app As Application
Set app = Application

See the Advanced Projects section of the documentation for more information on creating or obtaining a reference to an existing TurboCAD Application object only when you design an external custom application.


Destroying the Application Object

If you want to write a macro that shuts down the active instance of TurboCAD, you can use the Application object's Quit method. After calling this method, any variables holding a reference to the application, and the global Application property should be considered invalid, and you should not use any more TurboCAD objects from this point on.

If you're writing standalone applications that use TurboCAD as an in-process or out-of-process server, consult the Advanced Projects section for information on how to destroy or detach from the TurboCAD Application object.


Getting the Application Name

The Name property is the default read only property of the Application object.

Debug.Print Application.Name

or

Debug.Print Application

will print "TurboCAD(tm) for Windows" in the VBA Immediate window. By using the Name property and the Windows API you can locate the TurboCAD application window.

Example code, please?


Showing and Hiding the Application

The Application object's Visible property can be used to show or hide all of TurboCAD's windows and palettes. To show the windows, set the property to True; to hide them, set the property to False:

'Hide TurboCAD from view
Application.Visible = False
'Is TurboCAD visible?
Debug.Print "Visible? " & Application.Visible


Getting the Active Drawing

The Application object's ActiveDrawing property returns the currently active Drawing object, i.e. the drawing whose window has the current focus:

Dim dwg As Drawing
Set dwg = Application.ActiveDrawing

See the Drawing object documentation for more information.


Getting the Current Selection

The Application object's Selection read only property returns the Selection collection of the active Drawing object, i.e. all currently selected graphic objects.

The following example prints the IDs and types of all currently selected graphic objects to the Immediate Window:

Dim gr As Graphic
Debug.Print "Selection contents:"
For Each gr In Application.Selection
     Debug.Print "ID: " & gr.ID & ", Type: " & gr.Type
Next

See the section on Collections of Graphics for more information on using the Selection collection.


Changing Active Snap Modes

Snap modes enable you to control how TurboCAD responds to mouse actions when you are drawing or editing. Some modes are mutually exclusive; others can be used in combination. This provides you with an enormous number of possible techniques, but the fundamental principles underlying all the modes are consistent and relatively simple. Once you understand these principles, you will be able to exploit them to find efficient and precise methods of drawing and editing.

There are two major categories of snap modes:

1. Snap modes, which determine where exactly TurboCAD defines a point when you click the mouse in the drawing area.

2. Coordinate system modes, which determine how you can use mathematical coordinates to specify the location of any point on the drawing.

The SnapModes property determines how mouse click coordinates are transformed to coordinates of a specific point in a TurboCAD drawing. For instance, if you set SnapModes property to 4 (imsiSnapGrid), all mouse clicks will be interpreted as occurring in the nearest grid intersection. For more details on Snap Modes in TurboCAD refer to TurboCAD Help.

This SnapModes property setting can be any combination of the following values (ImsiSnapMode Enum):

Snap Modes
Snap Mode | Value | Description
imsiSnapOff | 1 | No additional calculations are performed upon mouse click
imsiSnapOrtho | 2 |
imsiSnapGrid | 4 | Mouse click is treated as if it happened in the nearest grid point
imsiSnapNearestPoint | 8 | Mouse click is treated as if it happened in the nearest vertex of the nearest graphics object
imsiSnapIntersection | 16 | Mouse click is treated as if it happened in the nearest intersection of closest graphics objects
imsiSnapMidpoint | 32 | Mouse click is treated as if it happened in the middle of the nearest line segment
imsiSnapCenter | 64 | Mouse click is treated as if it happened in the nearest vertex of the nearest arc object
imsiSnapQuadrant | 128 |
imsiSnapEntity | 256 | Mouse click is treated as if it happened in the nearest point of the nearest graphics object
imsiSnapProjection | 512 |
imsiSnapMirror | 1024 |
imsiSnapRelocate | 2048 |

The following example sets the Application object's SnapModes property to Grid (numeric value = 4):

Application.SnapModes = imsiSnapGrid

imsiSnapGrid mode is not applicable when you use TurboCAD engine as in-process server, due to internal TurboCAD functioning.

what about Application.Properties("SnapMode")?


Using Application Extended Properties

The Properties readonly property returns the Application object's Properties collection (see the documentation on standard and extended properties for more information). Many of the Application object's extended properties can be used to change a variety of application-wide settings. For a full list of Application properties refer to the TurboCAD Visual Basic Reference.

This example shows how to modify the UndoBuffers property using Properties collection:

Application.Properties("UndoBuffers") = 99


Setting the Undo Capacity

To change the amount of memory that TurboCAD uses for remembering undoable actions, you use the Application UndoBuffers extended property. A larger value assigned to UndoBuffers will consume more memory, but will allow more actions to be undone. The value for UndoBuffers can't be zero. If you try setting this property to zero TurboCAD will reset it to 1.

It is not recommended to assign UndoBuffers value greater than default (100). Theoretically you can assign any valid integer value for this property, yet you have to bear in mind that while user is working on a drawing each new action is saved to Undo buffer reducing physical computer memory and slowing down overall performance. Eventually an unreasonable UndoBuffers setting may even result in a system crash if all available memory is used up by Undo buffer. On the contrary setting UndoBuffers property to a value lesser than default may improve performance.

Example of setting the UndoBuffers property:

Application.Properties("UndoBuffers") = 10


Turning the AutoSave Feature On or Off

Sometimes when you're working on large or complex projects you might want to turn Auto Save feature off to improve performance. You can turn the AutoSaveOption off programmatically by using the Application object's AutoSaveOption extended property.

Application.Properties ("AutoSaveOption") = False


Changing the Display Color for Paper

You can control the color displayed for the paper areas in your drawing windows, by setting the Application object's PaperColor extended property. You can use any long integer that represents a valid color. You can also specify a color by using the RGB function with red, green, and blue color components. The value of each color component is an integer that ranges from zero to 255. For example, you can set PaperColor to green as the integer value 4966415 or as red, green, and blue color components 15, 200, 75:

Application.Properties("PaperColor") = 4966415
Application.Properties("PaperColor")= RGB(15, 200, 75)

For more information on colors, see the section on NamedColor objects.


Changing the Display Color for the Background

You can control the color displayed for the areas around the paper in your drawing windows, by setting the Application object's BackgroundColor extended property. You can use any long integer that represents a valid color. You can also specify a color by using the RGB function with red, green, and blue color components. The value of each color component is an integer that ranges from zero to 255. For example, you can set BackgroundColor to green as the integer value 4966415 or as red, green, and blue color components 15, 200, 75:

Application.Properties("BackgroundColor") = 4966415
Application.Properties("BackgroundColor")= RGB(15, 200, 75)

For more information on colors, see the section on NamedColor objects.


Displaying a "File Open" Dialog

You can use the Application object's GetOpenFilename method to display a dialog that lets a user choose a file to open in TurboCAD. GetOpenFilename has the following syntax:

Application.GetOpenFilename ([Filter], [Title], [ButtonText], [MultiSelect])

All parameters of the GetOpenFileName method are optional. Meaning of each parameter is given in the table below:

Part | Description
Filter | Optional, Sting. A three-character file extension, e.g. "DWG" by which the files are filtered in the dialog box. By default the list of files contains all filters registered in TurboCAD. Non-functional in current release, reserved for future implementation.
Title | Optional, String. Sets dialog box title.
ButtonText | Optional, String. Non-functional in current release, reserved for future implementation.
MultiSelect | Optional, Boolean. Specifies if user can select more than one file in the Open File dialog box. Default: False. Non-functional in current release, reserved for future implementation.


Displaying a "File Save" Dialog

You can use the Application object's GetSaveAsFilename method to display a dialog that lets a user choose a file name to save in TurboCAD. The GetSaveAsFilename method has the following syntax:

Application.GetSaveAsFileName ([Filter], [Title], [ButtonText], [MultiSelect])

All parameters of the GetSaveAsFilename method are optional. Meaning of each parameter is given in the table below:

Part | Description
Filter | Optional, Sting. A three-character file extension, e.g. "DWG" by which the files are filtered in the dialog box. By default the list of files contains all filters registered in TurboCAD. Non-functional in current release, reserved for future implementation.
Title | Optional, String. Sets dialog box title.
ButtonText | Optional, String. Non-functional in current release, reserved for future implementation.
MultiSelect | Optional, Boolean. Specifies if user can select more than one file in the Open File dialog box. Default: False. Non-functional in current release, reserved for future implementation.

For example, the following line of code will open Save As dialog box with "MyFile" as file name and "MySaveAsDialog" as title:

strSaveFileName = Application.GetSaveAsFilename ("MyFile",,"MySaveAsDialog")

After pressing OK in the dialog box user will assign full path to strSaveFileName variable.


Using Other Application Properties and Methods

For information on other properties, see the following sections:

"Modifying the Application Environment"

"Using Events"

"TurboCAD Visual Basic Reference"

"Advanced Projects"


The Drawing Object

The Drawing object represents a TurboCAD drawing and is a member of the global and Application Drawings collections.

The Drawing object is a container for all the graphic and style data that is stored in a TurboCAD file. This data is organized in a series of collections that are read-only properties of the Drawing object.

Block, BrushStyle, Layer, and LineStyle objects can also be accessed through Graphic object (see details in TurboCAD Graphics). However, these objects cannot be created using Graphic object since Graphic object can only work with existing objects. To create new Block, BrushStyle, Layer, and LineStyle objects you must access a respective collection though the Drawing object.


What's in a Drawing?

Drawing object has nearly four hundred properties, in this section we discuss only those properties that manipulate Drawing object as a whole. There are also Drawing properties that apply to graphic objects within a Drawing object; these will be discussed in detail in section 5.1, Specifics of various TurboCAD 's graphics. This section focuses on the most commonly used properties and methods of the Drawing Object. The list of those properties and methods is given below.

Drawing Standard Properties
Property | Description
Name | Returns full path and name of the Drawing object.
Path | Returns full path to the drawing object, same as Name.
Saved | Returns or sets Saved property of the Drawing object.
Properties | Returns the Drawing object's Properties collection.
Layers | Returns the Drawing object's Layers collection.
Blocks | Returns the Drawing object's Blocks collection.
Views | Returns the Drawing object's Views collection.
NamedViews | Returns the Drawing object's NamedViews collection.
ActiveView | Returns the Drawing object's ActiveView object.
TieSets | Returns the Drawing object's TieSets collection.
UCS | Returns or sets the Drawing UCS (User Coordinate System) as Matrix object.
Graphics | Returns the Drawing object's Graphics collection.
Selection | Returns the Drawing object's Selection object.
GraphicSets | Returns the Drawing object's GraphicSets collection.
BrushStyles | Returns the Drawing object's BrushStyles collection.
LineStyles | Returns the Drawing object's LineStyles collection.

Drawing Extended Properties
Property | Description
LinearUnitName | Get/set the name of currently used measurement units for Model Space (in, m, mm, etc.).
LinearUnitSystem | Get/set measurement system for Model Space (1 - English, 2 - Metric).
PaperLinearUnitName | Get/set the name of currently used measurement units for Paper Space (in, m, mm, etc.).
PaperLinearUnitName2 | Get/set the name of currently used measurement units for text in Paper Space (in, m, mm, pt, etc.).
PaperLinearUnitName3 | Get/set the name of currently used measurement units for line width in Paper Space (in, m, mm, pt, etc.).
PaperScale | Get/set the scaling for Paper Space (1:2, 1:3, etc.).
PaperScaleSystem | Get/set the scaling system for Paper Space.
TileMode | Get/set current drawing mode, i.e. Paper Space or Model Space.
$PLUNITS | Get/set measurement system for Paper Space (1 - English, 2 - Metric).
$SCALE | Get/set the scaling for Model Space (1:2, 1:3, etc.).
$SCALESYS | Get/set the scaling system for Model Space.

Drawing Methods
Method | Description
Activate | Makes the specified Drawing object the active Drawing object.
Close | Closes the Drawing object.
Save | Saves the whole specified drawing to a disk file even if no changes have been made to the drawing since last save.
SaveAs | Saves the entire drawing to a different file.
SaveCopyAs | Saves drawing to a specified file name and path, yet does not change the file name and path of currently open drawing file like SaveAs method does.
SelectAll | Selects all Graphic objects in the Drawing object's Graphics collection. Has the same effect as Drawing.Graphics.Select method.
UnselectAll | Unselects all of the Graphic objects in the Drawing object's Graphics collection. Has the same effect as Drawing.Graphics.Unselect or Drawing.Selection.Unselect.


Working with Drawings

In TurboCAD you can work with more than one drawing at a time. The Application Object's Drawings collection owns and maintains the access to the currently open drawings. You can open existing drawings or create new drawings using the Drawings collection's Open and Add methods. You can also access and modify all open drawings in your current TurboCAD session.


Opening an Existing Drawing

To open a previously saved TurboCAD drawing use the Open method is the method of the Drawings collection of the Application object.

You can open an existing drawing file using instruction similar to the one below (supply your actual path and file name):

Dim dwg As Drawing
Set dwg = app.Drawings.Open("C:\Program Files\IMSI\TCWP70\Drawings\Drawing1.tcw")

If you're working within TurboCAD VBA environment the Application object exists implicitly so you may omit it, since the Drawings collection is exposed as a global property. You could also write:

Dim dwg As Drawing
Set dwg = Drawings.Open("C:\Program Files\IMSI\TCWP70\Drawings\Drawing1.tcw")

to open the drawing.


Creating a New Drawing

New drawings are created from scratch by using the Add method of the Drawings collection of the Application, or the global Drawings property. When you create a new drawing from scratch, you can supply a name that will be shown in the window caption:

'create a new drawing from scratch
Dim dwg As Drawing
Set dwg = app.Drawings.Add("MyNewDrawingName")


Accessing the Active Drawing

In TurboCAD the active drawing is any drawing that has the focus. The active drawing notion makes sense only when you programmatically manipulate TurboCAD using the Visual Basic for Applications environment, or when TurboCAD engine runs as out-of-process server. For information on using drawings for in-process server applications, see the Advanced Projects section of the documentation.

Normally when you open or create a drawing, it becomes the active drawing.

To gain an access to the currently active drawing use the Application object's or the global ActiveDrawing property:

Dim dwg As Drawing
Set dwg = ActiveDrawing
'you could also use:
Set dwg = app.ActiveDrawing
MsgBox "The currently active drawing is " & dwg.Name

should we also add support for a ThisDrawing object in VBA?


Saving a Drawing

The Drawing object exposes three methods allowing to save a TurboCAD drawing to a disk file: Save, SaveAs, and SaveCopyAs. Specifics of using each method are discussed in this section.

Using the Save Method

The Save method saves the whole specified drawing to a disk file even if no changes have been made to the drawing since last save.

You cannot use Save method to save new drawings, use SaveAs method instead. If the Save method is applied to a new drawing, i.e. a drawing not yet saved to a disk file, the method will fail with an error.

should we change this behavior if you supply the correct path?

Here's an example of opening and saving a drawing:

Dim dwg as Drawing
Set dwg = Drawings.Open("C:\Program Files\IMSI\TCWP70\Drawings\Drawing1.tcw")
' . . . do something with the drawing
dwg.Save

Using the SaveAs Method

To save a previously unsaved drawing, or to save an existing drawing to a different disk file use the SaveAs method of the Drawing object:

Dim dwg As Drawing
Set dwg = ActiveDrawing
dwg.SaveAs "C:\My Documents\Projects\NewDrawingFile.TCW"

After saving, the file name and path will be updated in the drawing window to point to the new settings.

The path to the folder specified in the SaveAs method must exist, or the SaveAs method will fail with an error.

The SaveAs method does not check if the specified file name exists. If a file with the specified name does exist in the specified directory, it will be overwritten by the SaveAs method.

Using the SaveCopyAs Method

The SaveCopyAs method saves drawing to a specified file name and path, yet unlike the SaveAs method does not change the file name and path of currently open drawing file. Example:

Dim dwg As Drawing
Set dwg = ActiveDrawing
dwg.SaveCopyAs "C:\My Documents\Projects\DrawingFileCopy.TCW"

The SaveCopyAs method does not check if the specified file name exists. If a file with the specified name does exist in the specified directory, it will be overwritten by the SaveCopyAs method.


Closing a Drawing

You can close an open drawing by executing the Drawing object's Close method.

If you have created a Drawing object and assigned it to an object variable, and then closed the drawing, the memory that TurboCAD uses for the Drawing object has not been released, and the reference in the object variable cannot be used anymore (since the drawing doesn't exist). Good programming style recommends to release the object variable memory by immediately releasing the now unusable variable reference, using Visual Basic's Nothing keyword:

Sub CloseDrawingExample()
Dim dwg As Drawing
'Display full name of the open drawing
'Get total number of currently open drawings
'Close drawing object without prompting for save
    dwg.Close False
'Immediately release reference to closed drawing
    Set dwg = Nothing
'Get total number of currently open drawings
'to make sure it decreased by 1
    MsgBox "Total drawings = " & Drawings.Count
End Sub


Closing All Drawings in an Application

To close all open drawings, use the CloseAll method of the global or Application object Drawings collection:

'close all the drawings in the Application
app.Drawings.CloseAll


Making a Drawing the Active Drawing

You can use the use the Activate method to activate a specified Drawing, i.e. make it the ActiveDrawing object:

'make the first drawing the active one
app.Drawings(0).Activate


Getting the Drawing's Name

The Drawing object's default, read only Name property returns the name of the currently active drawing as a String. For example, the ActiveDrawing instruction executed in the TurboCAD VBA Editor's Immediate Window will return something like

Drawing1

for a new drawing, not yet saved to disk and something like

C:\Program Files\IMSI\TCWP70\Drawings\Drawing1.tcw

for an existing drawing or a drawing already saved to disk.


Getting the Drawing's File Name

You use the Path property to find out the file name of the last Save or SaveAs operation:

Need example


Finding Out If Changes Have Been Made to a Drawing

The Saved property of the Drawing object is True if no changes have been made to the Drawing object since it was last saved.

When you open a new blank drawing in TurboCAD its Saved property is False. If you have programmatically created a TurboCAD Application object it opens a new blank drawing with Saved property set to False. In this case you may want to set the drawing's Saved property to True (without actually saving the drawing) before closing TurboCAD Application object (using Application.Quit method) to avoid being prompted to save an open drawing, for example:

ActiveDrawing.Saved = True

To actually save an open drawing use the Drawing object's Save method (see Using Drawing Methods, Save).


Setting up Drawing Units

Before you work with a new drawing, it's important to set the correct unit system. Usually you'll want to add objects to a uniformly scaled workspace, called Model Space. Two extended properties allow you to control the unit settings for Model Space: LinearUnitSystem and LinearUnitName.

LinearUnitSystem

This Drawing extended property controls the measurement system for Model Space. The default setting for the Model Space measurement system depends on your locale. To change the LinearUnitSystem property setting assign it an Integer with the following allowed values:

1: English System

2: Metric System

For example:

'Set model space measurement unit system to Metric
ActiveDrawing.Properties("LinearUnitSystem") = 2

LinearUnitName

This Drawing property returns a String containing the name of the current measurement units, e.g. "in" for inches, "mm" for millimeters. The default setting for the LinearUnitName property is "in". To change the LinearUnitName property setting assign it a String with the name of the specified measurement units:

'Set measurement unit name to millimeters
ActiveDrawing.Properties("LinearUnitName") = "mm"

The LinearUnitName setting must correspond to the LinearUnitSystem setting, i.e. if you set LinearUnitSystem to 1 (English) you should use English measurement units. Theoretically it is possible to specify measurement unit name conflicting with the measurement unit system, yet it might cause unpredictable results.

other model space settings

A drawing also contains at least one Paper Space, a workspace that is used to hold Graphics that will be printed on a scale determined by the sheet to be printed. The Drawing object has a set of analogous properties that allow you to set the units and size of the paper. These paper space properties are discussed in the section "Working with Model Space and Paper Space"


Changing the Drawing's Coordinate System

Returns or sets the Drawing UCS (User Coordinate System) as Matrix object. Read-Write. (See details on representing Coordinate System as matrix and working with matrix in section 5.3, TurboCAD Inside).

Syntax

Object.UCS where Object must be a valid Drawing object.

Example

Dim MyTCApp as New TurboCAD.Application
Dim MyDwg As Drawing, MyUCS As EMatrix
Set MyDwg = MyTCApp.ActiveDrawing
Set MyUCS = MyDwg.UCS


Using Other Drawing Properties and Methods

See the following sections for more information:

"Graphic Appearance" for the use of the BrushStyle and LineStyle objects stored in Drawing collections.

"Collections of Graphics" for the use of Graphics, Selection, Layer, Block and GraphicSet objects as collections for graphics

"The View Object" for information on a Drawing's ActiveView, and the collections of Views and NamedViews owned by a Drawing.

"Working with Model Space and Paper Space" for information on how Graphics can be scaled differently on individual sheets.

"Advanced Projects" for information on TieSets

"TurboCAD Visual Basic Reference" on all drawing properties and methods


TurboCAD Graphics: Subtypes, Hierarchy, Geometry and Appearance

To do anything useful with the TurboCAD SDK, you will interact with TurboCAD's Graphic object type. In order to know how you can best work with the TurboCAD library, it is important to understand the basic concepts of how Graphic objects behave.

The Graphic object type (this type is called an "entity" in some systems) in the TurboCAD SDK encompasses different subtypes. For example, circles, polylines, text, and 3D solids are all different subtypes of the Graphic object.

Unlike some other CAD packages, Graphics in TurboCAD are arranged in a hierarchy; in other words, TurboCAD Graphic objects can contain child Graphic objects. Graphic objects can exist as independent objects. However, typically Graphic objects are "owned"-they usually exist in a hierarchy of ownership which descends from a Drawing or Block object.

Obviously, Graphic objects must specify geometry. One way that geometry is expressed in the TurboCAD engine through the hierarchy of parent and child Graphic objects. Another way that the geometry is expressed is that every Graphic object contains a collection of Vertex objects, accessible through the Graphic's Vertices collection.

Different subtypes of Graphics use the ordered Vertices collection to specify different parameters for the Graphic; for example, a polyline Graphic uses the vertices to specify the coordinates of the sequence of endpoints of the line segments that compose the polyline, whereas an arc Graphic specifies four different points in its Vertices collection that define the basis for the mathematical definition of the arc. The Vertex objects in the Graphic's Vertices collection also contain other information besides coordinate locations.

code example for showing vertices

Furthermore, each Graphic object contains a Matrix object that transforms the Graphic from a local coordinate system into its parent coordinate system. Since the Graphics form a hierarchy, these Matrix transformations are concatentated until the top of the hierarchy is reached.

code example for showing matrix

Is this right???

Details of how the Graphic is displayed is also specified by information accessible through the Graphic object. For instance, the dash-dot pattern of a 2D graphic may be obtained by querying the LineStyle object referenced from the Graphic, or the color of the line changed by using the PenColor extended property of the Graphic.

code example for showing LineStyle

For most Graphic subtypes, other extended properties (most of which are exposed to the TurboCAD user through the selection property pages) control all of the geometry and appearance of the Graphic.

code example for showing one extended property


TurboCAD's Graphic Hierarchy

At the top of the hierarchy is a graphic container. This is a collection object, typically exposed by a Drawing, Layer, Block, PaperSpace, or other object through that object's Graphics property:

Dim grs As Graphics
Set grs = ActiveDrawing.Graphics

A Block object (a hierarchy of Graphics that can be referenced though multiple insertions in a Drawing) is in many ways analogous to a Drawing, and it also has a root graphic. To access the Graphic hierarchy contained in a block, you would write:

Dim blk As Block
Dim grs As Graphics
Set blk = ActiveDrawing.Blocks("A_BLOCK_NAME")
Set grs = blk.Graphics

Other graphic containers that provide the top level of containment are the Selection and GraphicSet objects.

Below this top level container, Graphic objects are themselves containers; they expose a Graphics collection through their Graphics property, thus creating a nested or tree-like structure. Thus, TurboCAD and the SDK allow you to arrange Graphic objects in hierarchical groups. A group in TurboCAD is a just a Graphic subtype that typically has no vertices, only child Graphic objects.

For a more detailed description of how these graphic collections behave, see "Collections of Graphics".


Under the Hood of TurboCAD's Graphic Engine

The TurboCAD engine takes the parametric specification data contained within the Graphic objects to mathematically define the different Graphic subtypes. It also creates and maintains additional information (stored in the Graphic's Vertices, Graphics, and Properties collections).

Each Graphic subtype is manipulated by handler procedures that read and modify the information contained in a Graphic during the course of operations such as creation, destruction, copying and rendering of the Graphic. For some Graphic subtypes, like polylines, these handlers are contained within the core TurboCAD engine. We will call these "basic subtypes". Most Graphic subtypes are handled by extension DLL's ("Regen" or "Regen Method" DLL's that are placed in the Regens subdirectory) that extend basic functionality and allow for more sophisticated behavior. Using the SDK, you can define your own custom Graphic subtypes by creating these extensions. We will call this group of Graphic subtypes "Regens" for short. See the Advanced Projects section for a detailed explanation of how to build your own custom Graphic object subtype.

code example for finding regen

When operating with the data contained in the Graphic object, all handlers respect certain rules that are common to all Graphic subtypes. There are predefined "flags" attached to Graphic objects and their contents that help the handlers display and manipulate the data. For instance the selection state of the Graphic, and the availability of each of the Graphic's vertices for "node editing" are two abilities that are controlled by these flags.

Some of a Graphic's extended properties are shared by all Graphic subtypes. Others are specific to a particular type.

NOTE Be sure to provide error handling code for extended properties that may be listed but undefined. For more information see "Using the Property Object".


Basic Graphic Subtypes

The TurboCAD graphic system includes a small set of core subtypes that are used for handling primitive graphic elements such as polylines, arcs and circles, and viewports. The routines that work with these basic subtypes are contained within the DLL's in the TurboCAD Program directory.

Information about the layout of a basic subtype's vertices, child graphics and properties is provided in the "Basic and Regen Graphics In Detail" sections.


Regen Graphic Subtypes

As an extensible system, other graphic elements are built up from the basic subtypes. These extended subtypes are called "Regens" and the routines that handle them are packaged in DLL's in the TurboCAD Regens subdirectory. Examples of Regen subtypes that are shipped with TurboCAD are: double line, multiline, dimensions, ACIS solids. Text elements are also handled by the Regen system.

One Regen DLL (such as the dimension DLL) can support many subtypes (linear dimensions, radial dimensions, etc.). It is possible for you to write your own extensible subtype using Visual Basic or Visual C++. For more information on the Regen system, see the "Advanced Projects" section of the documentation.

Information about the layout of a regen subtype's vertices, child graphics and properties is provided in the "Basic and Regen Graphics In Detail" sections.


What's in a Graphic?

The following tables list the most commonly used properties and methods common to all graphic subtypes. Details of how to use these properties and methods will be introduced in later sections that provide information on how to accomplish common tasks with Graphic objects.

You can examine the standard and extended properties of a graphic, and its child hierarchy, using the "Extended Selection Info" sample macro.

Graphic Standard Properties
Property | Description
Parent | Returns parent object to which the Graphic object belongs. Should this be a paper space object if the graphic is in paper space?
Application | Navigation access to the Application object which owns this Graphic.
Drawing | Navigation access to the Drawing object which owns this Graphic.
ID | Integer: Unique identifier for the Graphic.
Type | String: Describes the Graphic's subtype.
Cosmetic | Boolean: True if the Graphic object is used for display regeneration only.
Editable | Boolean: True if the Graphic object can be edited in the user interface.
Visible | Boolean: True if the Graphic is to be drawn on the screen.
Closed | Boolean: True if the Graphic is closed (a segment connects the last Vertex in the Vertices collection to the first).
Unbounded | Boolean: True if the Graphic has no endpoints (e.g. for construction lines).
Selected | Boolean: True if the Graphic is part of the current selection.
BuiltIn | Boolean: True if the object is one of the core basic subtypes.
Root | Boolean: True if the Graphic is at the root of a hierarchy.
UCS | The Matrix object that transforms this Graphic into its parent's coordinate system.
Graphics | The collection of child Graphic objects contained by this Graphic object.
Vertices | The collection of the Graphic's vertices.
Nodes | The sub-collection of the Graphic's vertices that are node-editable.
Properties | The collection of the Graphic's extended properties.
Attributes | The collection of the Graphic's attribute properties. Are these actually Graphics?
Layer | The Layer object that represents the drawing layer that this Graphic is assigned to.
LineStyle | A LineStyle object that describes the pattern applied when drawing the outline or stroke of the graphic.
BrushStyle | A BrushStyle object that describes the pattern applied when drawing the filled area of the graphic.
RegenType | String: Describes the Graphic's subtype handler. Doesn't seem to be implemented.
Deleted | Boolean: True if the Graphic object is on the purge/undo list. Doesn't seem to be useful or implemented.
ZOrder | An Integer that is used to sort the Graphic in its collection during rendering. Not implemented.

Graphic Extended Properties
Property | Description
PenColor | Long: 24-bit RGB value of the color used to draw the outline or stroke of the graphic.
PenWidth | Double: Width of pen in model space or paper space units.
BrushColor | Long: 24-bit RGB value of the color used to draw the filled area of the graphic.
TextColor | Long: 24-bit RGB value of the color used to draw text graphics.

Graphic Methods
Method | Description
Duplicate | Creates an copy of a Graphic object in the collection that owns this Graphic.
Delete | Destroys the Graphic object and removes it from its parent collection.
Draw | Forces a rendering of the Graphic.
Update | Forces update of the Graphic object's properties.
Select, Unselect | Changes the selection state of the Graphic.
BringToFront, SendToBack | Changes the z-order of the Graphic to place it at the front or back of its collection's drawing order.
MoveAbsolute, MoveRelative | Translates the Graphic's position.
RotateAbsolute, RotateAxis | Rotates the Graphic's orientation.
Scale | Changes the scale of the Graphic.
Transform | Changes the Graphic's position, rotation and scale by using a Matrix multiplication.
Explode | Explodes a Graphic object and returns a GraphicSet object, which is a sub-collection containing the Graphics resulting from the explode operation.
LinearCopyAbsolute, LinearCopyRelative, RadialCopyAbsolute, RadialCopyRelative, ArrayCopyAbsolute, ArrayCopyRelative | Returns a GraphicSet object containing the results of a copy operation.
CalcBoundingBox | Calculates and creates a BoundingBox object for the Graphic.
GetDistance | Calculates the minimum distance from a specified 3D world location to the Graphic.
RegenLock, RegenUnlock | Methods used by regen handling routines to prevent re-entrant recalculation of cosmetic graphics. See the "Advanced Projects" section for details.


Cosmetic and Non-cosmetic Graphics

One of the key concepts in TurboCAD's graphic system is that of a "cosmetic" graphic. For a given graphic subtype, TurboCAD (or you as the author of a custom regen) use a specific list of vertices and properties that uniquely define the geometry of the graphic. However the graphic is often rendered not just as a polyline or arc connecting these defining vertices. Instead the regen handling routines generate a visible representation of the graphic when any of the defining vertices or properties are changed.

This visible representation is called a cosmetic graphic, and it is usually a polyline approximation, added as a child graphic to the defining graphic. The regen handler code maintains the state of this cosmetic graphic, destroying and rebuilding it every time the geometry or properties of the defining graphic are modified.

If you walk through the graphic hierarchy of a drawing that contains a regen graphic, you can identify these cosmetic graphics by a True value of a Graphic object's Cosmetic standard property.

Show example

Normally only the regen handling code itself should attempt to modify these transient cosmetic graphics. Do not hold references to cosmetic graphics in your Visual Basic for Applications code for long periods of time-an individual cosmetic graphic's lifetime may only last for the duration of one rendering pass.


Editable and Non-Editable Graphics

Another property that you can inspect and modify is a Graphic object's Editable property. By setting this property to False, you can disable modification of the object in the user interface. Most graphics are meant to be fully Editable, and it is generally not recommended that you change the Editable state of cosmetic graphics.


Model Space and Paper Space Graphics

Graphics exist in one of two workspaces in a Drawing: Model Space or Paper Space. When you add the graphic to a Drawing object's Graphics collection, the current space setting determines which space the graphic belongs to. Most of the examples in this documentation concerning graphics assume that you will use Model Space to build most graphics. See the section on Working with Paper Space for more information.

How can you determine which space the Graphic is in if you have a reference to it?


Defining Graphic Geometry: Using the Vertices Collection

Querying or modifying a Graphic object's shape or position usually involves accessing its vertices. For some Graphics, such as the polyline, you the programmer have full control over adding, removing or modifying the contents of the Graphic's Vertices collection. Other more sophisticated types impose restrictions on the number and meaning for particular vertices. These rules and restrictions will be discussed under in the topics that explain specific Graphic subtypes. The examples and explanations that will be discussed here assume that you are working with the simplest kind of Graphic object, the polyline.

You can examine the vertices that define a graphic using the "Extended Selection Info" sample macro.


What's in a Vertex?

A Vertex object in a TurboCAD drawing is a point in three dimensional space. Vertex objects can be created as standalone, independent objects, or can be accessed as part of a Graphic object's Vertices collection contents.

The Vertex object serves to specify the 3D location of a control or reference point for its containing Graphic object. Modifying a Vertex object allows to reshape the parent Graphic object.

Other properties of the Vertex object control the visibility of segments that connect sequential vertices, and the curvature of arc segments in the polyline Graphic. You can also affect the behavior of many aspects of the user interface by setting Boolean properties that control selecting, snapping, and node editing capabilities.

Vertex Properties
Name | Description
Parent | If the Vertex is contained within a Graphic's Vertices collection, this returns the Graphic object.
Application | Navigation access to the Application object which owns this Vertex.
X | Double: X coordinate value of the vertex.
Y | Double: Y coordinate value of the vertex.
Z | Double: Z coordinate value of the vertex.
ID | Integer: A user-defined value that can be used to identify the Vertex.
Bulge | Boolean: True if this Vertex is an off-curve point that specifies an arc segment.
PenDown | Boolean: True if the line or arc segment from this point to the next vertex will be drawn.
Selectable | Boolean: True if the vertex can be selected in the user interface.
Editable | Boolean: True if the vertex can be "node edited" in the user interface
Snappable | Boolean: True if the vertex can be snapped to in the user interface.
Linkable | Boolean: True if the vertex can be linked to. For example only certain vertices on dimension graphics can be tied to other graphics.
Calculated | Boolean: True if the vertex is calculated from the graphic's geometry. The Calculated property allows for "cosmetic" vertices in non-cosmetic graphics.

Vertex Methods
Name | Description
Duplicate | Creates a copy of the vertex in the same collection as the original.
Delete | Removes the vertex from its owning collection.


Using a Vertex Object

To create a Vertex object prior to filling it with coordinates and other information, you can use the New statement:

Dim vtxNew As New Vertex
vtxNew.X = 1
vtxNew.Y = 2
vtxNew.Z = 3

To access a Vertex that is part of a Graphic's Vertices collection, you use standard methods for collections:

Dim gr As Graphic
Dim vtx As Vertex
Set gr = ActiveDrawing.Graphics(0)
Set vtx = gr.Vertices(0)


Adding a Vertex to a Graphic

If you are dealing with polylines, you can add new points to the polyline as follows:

Dim gr As Graphic
Dim vtx As Vertex
Set gr = ActiveDrawing.Graphics.Add
Set vtx = gr.Vertices.Add(0, 0, 0)
Set vtx = gr.Vertices.Add(1, 0, 0)
Set vtx = gr.Vertices.Add(1, 1, 0)

Warning Adding or Removing a Vertex from most Graphic subtypes might result in undefined behavior, including an application crash. Consult the documentation on specific Graphic subtypes for more information.

You can also insert new vertices into a polyline graphic by using the AddVertex method. This transfers ownership of the Vertex to the collection, and also allows you to control the index of the vertex in the collection. To insert a vertex after the third vertex (in other words, after the vertex with index 2):

Dim vtxNew as New Vertex
vtxNew.X = 0
vtxNew.Y = 1
vtxNew.Z = 0
gr.Vertices.AddVertex vtxNew, After:=2

If you are building a closed polygon, you can specify that the final vertex closes the polygon (ensuring that its coordinates will match the first vertex's, and setting the owning Graphic's Closed property to True) by using the AddClose method:

Set vtx = gr.Vertices.AddClose


Removing Vertex Objects from a Graphic

You remove a Vertex object from a Graphic's Vertices collection using the Remove method. This makes the Vertex ownerless. To remove the third vertex (the vertex with index 2):

Dim gr As Graphic
Dim vtx As Vertex
Set vtx = gr.Vertices.Remove(2)

If you already have a reference to a Vertex in a collection, you can achieve the same result by using the Delete method:

Dim gr As Graphic
Dim vtx As Vertex
Set vtx = gr.Vertices(2)
vtx.Delete

After the Vertex object has been removed, it is a standalone Vertex, and it will be destroyed as soon as all references to it go out of scope. You can force its destruction in the usual way:

Set vtx = Nothing

Warning Adding or Removing a Vertex from most Graphic types might result in undefined behavior, including an application crash. Consult the documentation on specific Graphic subtypes for more information.


Using Vertex Coordinate Values

The values of a coordinate property (X, Y, Z) in a Vertex that is part of a Graphic's Vertices collection can be specified in either the world coordinate system (WCS), shared between all Graphics in a drawing, or in the local coordinate system (LCS) of a Graphic object. Internally a Vertex object always stores its coordinates in LCS of the Graphic object it belongs to.

Before getting or setting the coordinate values, you can control the coordinate system, WCS or LCS, that you wish to work in. If you choose, the conversion to or from the WCS to the internal LCS is made at the time you get or set one or more of its X, Y, or Z properties.

To specify a coordinate system use UseWorldCS property (Boolean) of the Vertices collection that a particular Vertex object belongs to. Setting this property to TRUE will automatically convert LCS to WCS and vice versa.

The UseWorldCS property's scope is directly related to the Graphic object. This means that this property setting exists only as long as the corresponding Graphic object exists.

The UseWorldCS property is meaningful only the Vertex objects of the given collection, and does not affect higher hierarchy objects, e.g. Graphic. Also setting this property for Vertices collection of a parent Graphic object does not automatically set this property for Vertices collections of child Graphic objects.

More details on working with World and Local Coordinate Systems are discussed in the section World and local coordinate systems.


Graphic Position and Orientation: Using The UCS Matrix Object

A Matrix object encapsulates a 4x4 transformation. Matrix objects can be created by means of the New statement, which generates a reference to an identity transformation matrix:

Sub DebugMatrix(ByVal mtx As Matrix)
    Dim i, j As Integer
    Dim row As String

    For i = 0 To 3
        row = ""
        For j = 0 To 3
            row = row + CStr(mtx.GetEntry(i, j)) + "  "
            Next
            Debug.Print "row " & I & ": " & row
        Next
    Next
End Sub

Dim mtxIdentity As New Matrix
DebugMatrix mtxIdentity

Each Graphic in model space owns a Matrix that describes the transformation from its own user coordinate system (UCS) to its parent's coordinate system. This matrix is always a combination of pure rotation and translation (no scaling or shear is allowed). In paper space, Graphic objects are pre-transformed, so their UCS Matrix always returns an identity matrix.

Dim gr As Graphic
Dim mtxUCS As Matrix
Set mtxUCS = ActiveDrawing.Graphics(0).UCS
DebugMatrix mtxUCS

We'll discuss using matrices more under the Move, Copy, Transform sections; maybe we should just move this whole section there

How does this relate to workplanes in the user interface?


Attaching Data to Graphics Using Custom Graphic Properties

Because all Graphic objects have extended and custom property capabilities, you can attach your own arbitrary data to any graphic contained in a drawing. Just create the data and assign it to a named custom property.

NOTE Data added to cosmetic graphics via the use of custom properties is likely to be lost as the cosmetic graphics are rebuilt. Instead, always add the custom property to the parent, non-cosmetic graphic.

NOTE Custom properties are copied to new graphics as the result of copying and duplicating operations, either through the SDK or the user interface. If you want to maintain independent data for newly copied graphics, you must do it manually.


Adding a Custom Property

To add a custom property, supply a unique name and use the Properties collection's Add method:

Dim gr as Graphic
Dim newProp as Property
Set gr = ActiveDrawing.Graphics.AddSquare 'any old graphic will do
Set newProp = gr.Properties.Add("Weight")
newProp.Value = 10#
Debug.Print "The name of the new property is " & newProp.Name
Debug.Print "The type of the new property is " & prop.Type
Debug.Print "The current value of the new property is " & prop.Value

Note that by setting the Value, the custom property system will automatically detect and set the Type property of the object. In the case above, the "Weight" property was assigned a Visual Basic double-precision number, so the Type property will return vbDouble.

A Graphic's custom properties are automatically copied when the Graphic itself is copied. However the custom property does not automatically become attached to all Graphic objects of a given type, just the specific Graphic object that it has been created for.


Removing a Custom Property

Any property that you add through TurboCAD's custom property mechanism can be removed via the Property object's Delete method:

gr.Properties("Weight").Delete


Graphic Appearance: Using Colors, Styles, and Patterns


Changing the Color of a Graphic

Three extended properties, PenColor, BrushColor, and TextColor control the colors that are used to render a Graphic object. You can query these properties and modify them to change the Graphic's colors. Since they are extended properties, they may not exist for all Graphic subtypes, and you must refer to them using extended property syntax.

The type of these color properties is a Long, which represents a 24-bit packed value in the RGB (Red/Green/Blue) color space. Each component of the RGB color value can take an integral value from 0 to 255. To obtain the individual red, green or blue values, you can use code such as the following:

example showing use of these three

In addition to the 24-bit packed color values that you can assign to these properties, there are 4 contextual color values that you can use:

Contextual Color Values
Value | Description


Using Named Colors

TurboCAD uses an internal list of human-readable color names, such as "red", or "green", to display colors in its user interface. Each named color has associated properties, representing the intensities of the color as seen in the Red, Green and Blue channels of the RGB color space. For example, the named color "red" represents an intensity of 1.0 in the Red channel and 0.0 in the Green and Blue channels. The Windows operating system quantizes these intensities into 256 integer values (from 0 to 255) for each of the three channels, storing the RGB values in a 24-bit integer. Working with graphics in a drawing you can use the color names, Red, Green and Blue intensities, and 24-bit RGB values to assign colors to graphic objects, or create new colors. You can also work with another color space, the Hue-Saturation-Brightness or HSB system, and convert between one color space and the other.

The following example iterates through the NamedColors collection and prints each NamedColor name in the Immediate Window:

Dim nclr As NamedColor
For Each nclr In Application.NamedColors
      Debug.Print nclr.Name
Next

You can access a particular named color in the NamedColors collection by name:

example

You can add your own custom colors to this collection, by using the NamedColors.Add method:

example of adding a new named color to the named color collection


Using the NamedColor Object

The NamedColor object supports several properties for working with color:

NamedColor Standard Properties
Name | Description
Name | String. The name that identifies the named color.
Color | Long. The color's packed 24-bit RGB value.
Red | Double. The red component of the color, as a fraction in the range 0 to 1.
Green | Double. The green component of the color, as a fraction in the range 0 to 1.
Blue | Double. The blue component of the color, as a fraction in the range 0 to 1.
Hue | Double. The hue component of the color, as a number from 0 to 1. A pure blue hue has a value of 0 or 1, pure green is 0.333, pure red is 0.667, and intermediate values are blends.
Saturation | Double. The saturation component of the color as a fraction in the range 0 to 1. A saturation value of 0 represents a fully gray color (no red, green or blue contribution from the current hues), and a value of 1 represents the pure hue, with no grayness mixed in.
Brightness | Double. The brightness component of the color as a fraction in the range 0 to 1. A brightness value of 0 represents black, no matter what hue or saturation have been chosen, and 1 represents the full color.

You use the Color property to set a Graphic's PenColor, BrushColor, and TextColor property values, or a Drawing's BackgroundColor or PaperColor property values.

example of using named color to set graphic color

The NamedColor object allows you to get and set information about a color in the HSB ("Hue/Saturation/Brightness") color space. This is an alternate way to specify color information, that makes it easier to distinguish between different colors, and to modify colors in a palette of related tones. You can make a temporary NamedColor object and use it to convert between the RGB color space and the HSB color space. Note that individual color components in NamedColor objects are "normalized", that is, they all fall in the range from 0 to 1.

The following gives an example of how to use the HSB color space to specify related colors for a Graphic:

example


Using Line Styles

BrushStyle and LineStyle objects can also be accessed through Graphic object. However, these objects cannot be created using Graphic object since Graphic object can only work with existing objects. To create new BrushStyle, and LineStyle objects you must access a respective collection though the Drawing object.

Each Drawing contains a LineStyles collection that contains specifications for line drawing patterns. You can obtain information about a Graphic's line style through the LineStyle property, or set the line style by obtaining a LineStyle object from the LineStyles collection:

examples

You can also create new line style patterns and add them to the collection.

example


The LineStyle Object

The LineStyle object has properties that you can use:

LineStyle Properties
Name | Description
Name | String. The name that identifies the line style.
PatternLength | Double. The repeat length of the pattern.
Dashes | Double(). The array of dashes that consitute the pattern.

Need to give example


Using Brush Styles

similar text about brush styles


The BrushStyle Object

The BrushStyle object has properties that you can use:

BrushStyle Properties
Name | Description
Name | String. The name that identifies the brush style.
Type |
Color |
HatchStyle |
Bitmap |
Patterns |

example of changing color or bitmap


The BrushPattern Object

To specify new brush patterns contained in a brush style, you use the BrushPattern object. A brush pattern consists of a collection of individual vector items. Each item consists of a starting position (X and Y coordinates in the pattern space), height and width, and a rotation angle. You can query and modify the individual items by using these methods:

BrushPattern Methods
Name | Description
Count |
AddItem |
RemoveItem |
GetItem |
SetItem |

example of changing brush pattern info

note: Style Object is not implemented

question: any SDK interface for materials on 3D objects?


Using Graphic Collections

Before you can really begin to manipulate graphics effectively, it's important to understand the concept of ownership, and how different collection objects in the SDK maintain references to Graphic objects. A Graphic object can come into existence either as a standalone object, created by a New statement, or as an object owned by a collection, through a method invoked on a Graphics collection.

The containers that take ownership of the Graphic objects within them are the Drawing object, the Block object, and the Graphic object (since Graphic objects are maintained in a hierarchy). Each of these objects exposes a Graphics collection. These Graphics collection objects have strict ownership over the individual Graphic objects within them.

In addition, there are non-owning collections. These collections refer to the Graphic objects which are either standalone, or are owned by one of the primary Graphics collections. Examples of these non-owning collections are the GraphicSet (which is an arbitrary assemblage of Graphic objects that you can create to hold references to Graphics), the Selection object exposed by a Drawing, and the Graphics collection exposed by the Layer object. The PickEntry object can be thought of as a collection that references a single Graphic object, but does not own it.

The Layer's Graphics collection and Drawing's Selection object are special in that they are "sub-collections". They enumerate individual Graphic object elements of a Drawing's Graphics collections that meet specific criteria: either that the Graphic is attached to a particular layer, or that it's selection state is set.

The following matrix summarizes the different types of graphic collections that are available in the TurboCAD object model:

Graphic Collection Objects
Type of Collection | Types that own contained Graphic objects | Types that hold references to contained Graphic objects, but do not own them
Full collection | Drawing.Graphics Block.Graphics Graphic.Graphics PaperSpace.Graphics (deprecated) | GraphicSet (contained graphics can be standalone or owned by any other collection)
Sub-collection of full collection (full collection shown in parentheses) |  | Layer.Graphics (Drawing.Graphics) Drawing.Selection (Drawing.Graphics) PaperSpace.Selection (PaperSpace.Graphics) (deprecated)
Other objects that hold Graphic references |  | PickEntry (a "collection" of a single Graphic. Graphic is owned by Drawing.Graphics)


The Drawing Object's Graphics Collection

The Graphics сollection of a Drawing object provides access to individual Graphic objects in a drawing's active space. Depending on the Drawing's TileMode property value and the active PaperSpace, this collection will return different contents, reflecting the graphics contained in the particular workspace. More information on how model space and paper spaces interact with Drawing properties can be found in the "Working with Model Space and Paper Space" section.

Using the the Graphics collection you can:

· Create new Graphic objects.

· Iterate through Graphics collection.

· Manipulate all the Graphic objects in a drawing in batch operations.

· Destroy individual Graphics or the entire contents of the collection.

Since TurboCAD's graphic system allows for hierarchical groups and employs child cosmetic graphics, the Drawing's Graphics collection will just contain the "top-level" graphics, that are shown in the user interface.

Once you have access to the top-level graphics of a drawing, you can navigate down the hierarchy. For instance, you can use the a Graphic object's Graphics collection to get information or modify child graphics in a group.


Using Navigational Properties of a Graphic

Each Graphic object has properties that allow you to find out who its owner is, and to navigate up the object model hierarchy from a Graphic object to a Graphic collection.

Getting the Parent property returns an Application, Drawing, or Block object, depending on whether the Graphic is standalone, owned by a Drawing or owned by a Block.

Getting the Drawing property returns the Drawing object that the Graphic is contained by. Standalone Graphic objects return Nothing for this property. Setting the Drawing property of a Graphic to a Drawing automatically forces the removal of the Graphic from its current owner (if any) and transfers ownership to the new Drawing.

Getting the Block property returns the Block object that the Graphic is contained by. Standalone Graphic objects return Nothing for this property. Setting the Block property of a Graphic to a Block automatically forces the removal of the Graphic from its current owner (if any) and transfers ownership to the Block (which in turn is contained by a Drawing's Blocks collection).

Getting the Layer property returns the Layer object that the Graphic is attached to. Standalone Graphic objects return Nothing for this property. Setting the Layer property of a Graphic to a Layer automatically forces the removal of the Graphic from its current owner (if any) and transfers ownership to the Drawing which contains the Layer.

verify this with example code

To move down the object model hierarchy, you use the Graphics collection exposed by the Drawing, Block, or Graphic objects.

NOTE Block and Layer objects are always owned by a Drawing. To create new Block or Layer objects you must access a respective collection though the Drawing object.


Creating a Standalone Graphic Object

You can create a standalone Graphic object, that is not part of any drawing by using Visual Basic's New statement.

For example the following shows how a standalone graphic is created and destroyed:

    Dim gr As Graphic
    'Create standalone graphic
    Debug.Print "Creating standalone graphic"
    Set gr = New Graphic
    'Zero graphics in drawing
    Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"
    'Parent is IApplication
    Debug.Print "Parent type: " & TypeName(gr.Parent)
    'Graphic is NOT in drawing -- it's standalone
    Debug.Print "Graphic in drawing? " & (Not gr.Drawing Is Nothing)
    'Graphic will be destroyed
    Set gr = Nothing
    'Still zero graphics in drawing
    Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"


Creating a Graphic Owned by a Collection

Normally, you create a Graphic in the context of an owning collection, either a Drawing or a Block.

Here's an example that creates a graphic owned by the active drawing:

    Dim gr As Graphic
    'Create owned graphic
    Debug.Print "Adding graphic"
    Set gr = ActiveDrawing.Graphics.Add
    'One graphic in drawing now
    Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"
    'Parent is IGraphic -- bug?
    Debug.Print "Parent type: " & TypeName(gr.Parent)
    'Graphic is in drawing
    Debug.Print "Graphic in drawing? " & (Not gr.Drawing Is Nothing)
    'Graphic will NOT be destroyed -- we just lost a reference to it
    Set gr = Nothing
    'Still one graphic in drawing
    Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"


Destroying a Graphic Owned by a Collection

To delete the graphic you just added to the collection, there are two methods. If you have a reference to the graphic you can use the Graphic object's Delete method, which removes the Graphic from the collection and destroys it:

    'Delete owned graphic
    Debug.Print "Deleting graphic"
    gr.Delete
    Set gr = Nothing
    'Zero graphics in drawing now
    Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"

To delete all the Graphics in the collection, you can use the collection's Clear method:

ActiveDrawing.Graphics.Clear


Removing a Graphic from an Owning Collection

If you know the position or the Graphic in the collection, you can make it standalone again by using the collection's Remove method:

    Dim gr As Graphic
    Dim i As Integer
    'Remove graphic from collection -- make it standalone
    Debug.Print "Removing graphic from collection"
    Set gr = ActiveDrawing.Graphics.Remove(i)
    'Zero graphics in drawing now
    Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"
    'Parent is IGraphic -- bug?
    Debug.Print "Parent type: " & TypeName(gr.Parent)
    'Graphic is in drawing
    Debug.Print "Graphic in drawing? " & (Not gr.Drawing Is Nothing)
    'Release (and destroy) standalone
    Set gr = Nothing


Child Graphics: Creating a Group Hierarchy

If you want to create hierarchical groups of graphics that inherit copying and selection behavior from their parent, you can add child Graphic objects to a top-level group Graphic. A group Graphic is just a Graphic object (type is usually "GRAPHIC") that has no vertices of its own, and is just a container for child Graphic objects. You can create a group by using the Graphic collection's Add method.

Once you have created an empty group Graphic, you can add new graphics or move existing graphics into the group.

Bug: DBAPI Internal Failure when trying to move graphics from drawing into group. Workaround in the source code below.

Here's an example that takes the Graphics in the current selection, and makes them children of a new group Graphic.

Dim grGroup As Graphic

    'First make a group container
    Set grGroup = ActiveDrawing.Graphics.Add
    'Then add in the selected objects
    'This is made difficult because you the Selection object is not mutable
    'So we need to save the Graphic ID's in an array
    i = 0
    ReDim ids(0 To count - 1)
    For Each gr In ActiveDrawing.Selection
        ids(i) = gr.ID
        i = i + 1
    Next
    'Now recapture the ids and add the graphics to the group
    For i = 0 To count - 1
        Set gr = ActiveDrawing.Graphics.GraphicFromID(ids(i))

        'Selected no more
        gr.Unselect

        'Internal DBAPI Failure if you don't remove the graphic first
        ActiveDrawing.Graphics.Remove gr.Index
        grGroup.Graphics.AddGraphic gr
    Next


Removing a Graphic from a Group

Graphic objects can be removed from a group the same way that they are removed from a Drawing: by using the child Graphic object's Delete method, or the group Graphics collection's Remove method:

Need example

If all the graphics previously contained within a group have been removed, the empty group is not automatically destroyed. You can destroy an empty or non-empty group just as you would any other top-level Graphic, by calling its Delete method, or by removing it from the owning Drawing's Graphics collection.

Need example


Exploding a Group

Another useful technique is to create a temporary group, perform some operation (such as a transformation or LineStyle change) on the group and its children and then explode the group. The result of this is that the children that were added to the group are now owned by group's owning collection (usually a Drawing), and the group object itself is destroyed.

Need example


Using the Selection Object

Graphic objects maintain a True/False selection state. The TurboCAD user interface has what is called a noun-verb action paradigm. To perform most operations in the user interface, you first create or add to a selection (the "noun"), and then choose an operation to apply to the selection (the "verb"). You can build the selection using the SDK, so that when your macro stops, the user interface is ready to apply an operation.

The selection state of a single Graphic object can be determined by getting the value of its Selection read only property. You change the selection state of a Graphic object by using its Select and Unselect methods, or by adding it to a drawing's Selection collection.

The Drawing object's Selection object is a non-owning sub-collection of top-level Graphics in a drawing that are the result of a selection in the user interface. Graphic objects move into and out of this collection as the user performs selection operations. A common technique for Visual Basic for Application macros is to prompt for a selection operation, and then act on the contents of the Selection object.


Adding Graphics to the Selection

You add a Graphic object to the Drawing's Selection object by calling the Graphic's Select method. To select all the Graphic objects that belong to the Drawing object's Graphics collection use the Drawing object's SelectAll method. The SelectAll method of the Drawing object is synonymous to Select method of the Graphics collection (Drawing.Graphics.Select).

Need example

Other Graphics collections (GraphicSet and Layer) also have a Select method that selects all the Graphic objects in their contents.

Each Graphic has a Selected Boolean property that is True if the Graphic is part of a Drawing's Selection.

What happens to selections as other spaces are activated?


Removing Graphics from the Selection

You remove a Graphic object from the Drawing's Selection object by calling the Graphic's Unselect method. To unselect all previously selected Graphics objects in a Drawing use the UnselectAll method of the Drawing object. This method has a synonymous Unselect method in the Graphics collection (Drawing.Graphics.Unselect).

Need example

Other Graphics collections (GraphicSet and Layer) also have an Unselect method that unselects all the Graphic objects in their contents.


Graphics and Layers

Every Graphic that is owned by a Drawing or Block is assigned to a layer. You use the Drawing object's Layers collection to enumerate and modify the properties of layers in a Drawing, add new layers or delete existing layers.

A Layer is a virtual level in a drawing allowing to organize, i.e. logically group Graphic objects depending on their functionality, common uses, etc. For instance when creating a sophisticated building design you may want create subsets of such groups of Graphic objects as walls, electric fixtures, pipelines, etc.

This can be done through creation of separate layers for each functional group of objects. Layers allow you to work with each functional group of Graphic objects independently, with no interference of other Graphic objects or groups.

A new blank drawing has one default layer named "0". It is not recommended to rename or remove this default layer.

For more about how a layer can be used as a container of graphics, see Section 10, Collections of Graphics.


Creating a Layer

The following example creates three new layers in an active drawing for our hypothetical building project:

With ActiveDrawing.Layers
    .Add "Walls"
    .Add "Electrical"
    .Add "Piping"
Dim lyr As Layer
For Each lyr In ActiveDrawing.Layers
      Debug.Print lyr.Index & ": " & lyr.Name
Next


Destroying a Layer

To destroy a layer, you use the Delete method of the Layer object. However, you cannot destroy a layer if any Graphic objects are assigned to it. To destroy a non-empty layer first you need to destroy all Graphic objects with Layer property pointing to this layer. The easiest way to accomplish this is to use the Layer collection's Clear method and then destroy the layer:

Dim lyr As Layer
Set lyr = ActiveDrawing.Layers("Electrical")
lyr.AddSquare
lyr.AddCircle
lyr.Clear
lyr.Delete
Set lyr = Nothing


Using the Layer Object

You can use the following Layer object properties to control the behavior of all Graphics assigned to the layer:

Layer Standard Properties
Property | Description
Application |
Drawing |
Parent |
Name | The name of the layer, which can be used to index the Layers collection.
Index | Integer: The position of the Layer within the Layers collection.
Visible | Boolean: True if graphics assigned to this layer will be drawn.
Editable | Boolean: True if graphics assigned to this layer can be modified.
Color | The color value that will be applied to graphics on this layer whose PenColor or BrushColor properties are set to "ByLayer"
LineStyle | The LineStyle object that will be applied to graphics on this layer whose LineStyle property is set to "ByLayer".
BrushStyle | The BrushStyle object that will be applied to graphics on this layer whose BrushStyle property is set to "ByLayer".
Zorder | Priority by which graphics will be drawn.

Layers can be visible and invisible. If you want to work with a subset of Graphic objects in particular layer in your drawing, make all other layers invisible.

Layers can also be editable and non-editable. Making a layer non-editable protects Graphic objects in this layer from unintentional changes to those Graphic objects while someone is working with other Graphic objects in the same drawing.

To make a layer invisible set its Visible property to False. To protect a layer make it non-editable by setting its Editable property to False.

Use Color property to assign a specific color to a layer. If you want Graphic objects created in this layer to have color specified for that layer, set their Color property to "ByLayer", e.g.:

Dim gr As Graphic
'draw a circle
Set gr = ActiveDrawing.Graphics.AddCircle(0, 0, 0)
'place it into "Electrical" layer and assign it the layer's color
gr.Layer = "Electrical"

LineStyle and BrushStyle properties are similar to Color property, i.e. they allow to change the default appearance of Graphic objects in a particular layer.

The ZOrder property allows to change the layers drawing order. You can re-arrange layers' drawing order to change the order of appearance for Graphic objects in a drawing, i.e. you may specify which objects will be sent to back or front.


Accessing the Graphic Objects Assigned to a Layer

Since the Layer object is a collection, you can enumerate all the Graphics assigned to the Layer by using the For Each or indexing techniques:

Dim gr As Graphic
For Each gr In ActiveDrawing.Layers("0")
    Debug.Print gr.Type
Next


Adding a Graphic to a Layer

You can use the Layer object to construct Graphic objects immediately assigned to the layer, by using any of the Add methods exposed by the Layer object:

Set gr = lyr.AddSquare


Assigning a Graphic to a Layer

Each Graphic object has a Layer property that you can use to place Graphic objects on a layer. Once you've created a layer you can assign either its name or a reference to the Layer object to the Layer property of any Graphic object in your drawing:

gr.Layer = "Electrical"

Since the Layer object is a collection, another way to assign a Graphic to a Layer is to use the Layer's AddGraphic method:

lyr.AddGraphic gr


Graphics and Blocks

In TurboCAD a Block is a group of Graphic objects combined together into one object. Combining Graphic objects into a block is useful, for instance, when when you design a complex machine part that might be used as single entity in various places of a drawing (or in other drawings). A Block object inserted into a drawing is treated as one object, i.e. you can scale, rotate, delete as one object.

When you insert a Block into a drawing you don't add the whole combination of Graphic objects comprising the Block, instead you create a "Block insertion" Graphic object in the drawing. To modify all Blocks in a drawing you only need to modify the original Graphic objects in the Block.


What's in a Block?

Block Standard Properties
Property | Description
Application |
Drawing |
Parent |
Name | The name of the block, which can be used to index the Blocks collection.
Index | Integer: The position of the Block within the Blocks collection.
Graphics | The collection of Graphic objects that will be inserted by insertions which reference this Block.
Anchor | A Vertex object owned by the Block, which holds the X, Y, and Z coordinates of the origin of the Block.
XRef | (Read only)Boolean : True if the Block is an external reference to another drawing.
XRefPath | String: If the Block is an Xref, this property holds the location of the external drawing.


Creating a Block

To create a Block, you call the Add method of a Drawing object's Blocks collection, specifying the name of the new Block and passing a reference to a single graphic or group of graphics that will make up the Graphics collection owned by the Block. When the Block is created, its Graphics collection will contain the single graphic or group. You can also specify the anchor point (origin) of the new Block by supplying X, Y and Z coordinates. If these are omitted, the anchor point is set at the center of the single graphic or group's bounding box.

This is not such a great interface. Other options would be to allow passing a GraphicSet as well, or making the parameter optional, allowing users to first create the (empty) block, and then add graphics to it.

How will we handle the AddBlockAttribute stuff, if we want to maintain the "insert right away" functionality?

The implementation code also appears to pull drawing ownership from the group, not from the Blocks collection…

The following example draws a simple picture of a nut, creates a Block object using the picture's Graphic objects, and then inserts the Block object two times into the drawing:

Dim grs As Graphics
Dim grGroup As Graphic
Dim blks As Blocks
Set grs = ActiveDrawing.Graphics
'Create a group to hold individual Graphics for the Block
  Set grGroup = grs.Add(imsiPolyline)
'Draw a nut (add Graphics to group)
  With grGroup.Graphics
    .AddLinePolygon 5, 5, 0, 6, 5, 0, 6
    .AddCircleCenterAndPoint 5, 5, 0, 5 + 1 * Sin(3.14159 / 3), 5, 0
    .AddCircleCenterAndPoint 5, 5, 0, 5 + 0.5, 5, 0
  End With
'Create block using the group
  Set blks = ActiveDrawing.Blocks
  blks.Add "NutBlock", grGroup, , , , False, False, False
'The group is now gone from the drawing
'Insert two blocks into drawing
  grs.AddBlockInsertion "NutBlock", 2, 7, 0
  grs.AddBlockInsertion "NutBlock", 7, 2, 0


Creating an XRef Block

XRefs (references to other drawings) are a special kind of Block in TurboCAD. To create a new XRef, you call the AddXRef method of the Blocks collection, passing in the name for the new Block, and the path to the referenced drawing, as well as the optional anchor point (origin) coordinates.


Destroying a Block

Block objects are destroyed in the usual way, through a call to the Block object's Delete method. A block will not be deleted from a drawing, and an error will be raised, if there are any block insertions in the drawing that refer to the block. The only way to remove a block with referring insertions, is to enumerate the drawing's graphic's collection and delete the insertions first.


Block and Insert Attributes

Attributes are exposed as Properties also. See the section on blocks and inserts for how to add these.


Creating a Graphic Set

In a TurboCAD drawing you can combine any Graphic objects into a graphic set. The GraphicSet object provides a convenient way to hold references to a list of Graphics in a particular drawing that are otherwise unrelated. To add Graphic objects to a graphic set first you need to create a GraphicSet object using a drawing's GraphicSets collection:

Set gset = ActiveDrawing.GraphicSets.Add ("MyGraphicSet")

The following example creates three GraphicSets and prints their names to the Debug Window:

Sub CreateGraphicSets()
Dim dwg As Drawing, i As Integer
    Set dwg = ActiveDrawing
    For i = 1 To 3
        dwg.GraphicSets.Add "MySet" & i, False
    Next i
    For i = 0 To dwg.GraphicSets.Count - 1
        Debug.Print i + 1 & ": " & dwg.GraphicSets(i).Name
    Next
End Sub


Adding Graphics to a GraphicSet

After you have created a GraphicSet object you can add to it any Graphic object belonging to this drawing using the GraphicSet object's Add method:

Dim gr As Graphic
Set gr = ActiveDrawing.Graphics(0)
gset.AddGraphic gr

Combining Graphic objects into a GraphicSet is useful when you are working with a drawing that has many Graphic objects, and you want to subdivide them into groups using certain criteria (geometrical properties, color, user-defined property, etc.). GraphicSets as groups of Graphic objects sharing a common property provide a convenient way to perform operations on groups of Graphic objects meeting certain criteria. GraphicSet objects are returned by some methods of the Graphics collection, such the Explode and QuerySet.


Removing a Graphic from a GraphicSet

As with other collections you can remove Graphic objects from a GraphicSet by calling the GraphicSet's Remove method. Do not use Graphic.Delete unless you really want to destroy the Graphic.


Using the TurboCAD Graphic Query Engine

TurboCAD contains a lightweight database query engine, that you can use to find Graphics in a drawing that match a variety of criteria. The Graphics collection's QuerySet method launches the query engine and returns a result set containing the Graphics that satisfy the query criteria contained in a GraphicSet object. To search a drawing for Graphics that have a red pen color, for instance, you could use the following code:

Set gset = ActiveDrawing.Graphics.QuerySet("PenColor=255")

Need specification for query language

Need example


Batch Operations on Graphic Collections

Need to check implementation status


Common Uses of Graphic Objects

Note: this section should come AFTER introduction of graphic collections

Each topic should mention whether the same type of operation can be applied to parent Graphics collection, Layer, Selection, and/or GraphicSet collections. Maybe a small table could be placed in each topic to describe this

Linking Graphics Together: Ties and TieSets. TieSet stuff should probably go into Advanced section only

This section will discuss typical operations on graphics that you can use in the SDK.


Creating Graphics of Different Types

The Graphics and some of the other collections allow you to create Graphic objects of different types. Each of the basic Graphic subtypes in TurboCAD has one or more "shortcut" methods exposed by the Graphics collection. Each method lets you specify the resulting geometry in different ways. For example you can create a circle by specifying its center and radius, by two points on its diameter, etc. In addition the more general Graphics.Add method lets you create an "empty" graphic of an arbitrary subtype and then modify its vertex coordinates and child graphics after it has been created.

Examples for a few common Graphics.AddXXX methods

Some basic subtypes require more than a single call to a method to set them up. For example, polylines and polygons are created initially with no vertices. You make one method call to add each vertex, and finish the creation of the polyline with an AddClose call if the polyline is a closed figure. The following example creates a polyline approximating a sine wave:

Need example

If you know how the properties and geometry of TurboCAD's Regen graphics work, you can also create these subtypes using the Graphics.Add method as well. Ususally you create a Regen graphic in the Graphics collection, and then modify its properties, position, and other geometrical information to tailor the graphic the way you want. For instance you can create a leader line from a given point with the following code:

Need example

The section entitled "Basic and Regen Graphics in Detail" provides more information on for each of the basic and regen graphic subtypes.


Destroying a Graphic

Graphics can be destroyed by calling the Delete method on the Graphic object. After deleting the Graphic, make sure to set the variable reference to Nothing. Attempting to access any property or method in the Graphic after it has been deleted will result in an error.

Dim gr As Graphic
Set gr = ActiveDrawing.Graphics.Add
gr.Delete
Set gr = Nothing

Graphic.Deleted seems to have no purpose. Hide it? And forget this:

Because TurboCAD's undo engine allows you to undo deletion operations, the Graphic objects still exist in internal memory after you call Graphic.Delete, and your code may still hold references to deleted Graphics (although this is not recommended). You can check whether any of the variables in your code point to Graphics that no longer exist by inspecting the Graphic object's Deleted property.

You can also invoke the Clear method on a graphics collection that owns a number of Graphic objects to destroy all of its contents.


Copying a Graphic

You can make a copy of any graphic using the Duplicate method. The Duplicate method makes a "deep copy" of the graphic, copying all of the graphic's properties, vertices and child graphics. The resultant graphic is placed at the top level of the containing collection, and it and its cloned child graphics receive new Ids.

Note that after using the Duplicate method, there is no link from the newly cloned graphic to the original. If you want to make copies that refer to a master original, the correct way is to make the master a block graphic, and then create block insertions.

The following code demonstrates creating a graphic, duplicating it several times, repositioning the copied graphics, and then modifying the original after the operation is completed.

    Dim gr0 As Graphic
    Dim gr As Graphic
    Dim i As Integer
    Dim x As Double
    Dim y As Double

    'Make a circle centered at 1, 0, 0
    Set gr0 = ActiveDrawing.Graphics.AddCircleCenterAndPoint(1, 0, 0, 0, 0, 0)

    For i = 1 To 5
        'Clone original
        Set gr = gr0.Duplicate

        'Move to clone to point on the unit circle
        x = Cos(i * 3.14159 / 3)
        y = Sin(i * 3.14159 / 3)
        gr.MoveAbsolute x, y, 0
    Next i
    'Modify original -- clones are not affected
    With gr0.Properties
        .Item("BrushStyle") = "Solid"
        .Item("BrushColor") = NamedColors("Red")
    End With

Note: Graphic.LinearCopyXXX, .ArrayCopyXXX, .RadialCopyXXX are to be hidden. Can we write equivalents for these, in VBA, using Duplicate?


Finding the Size of a Graphic: the BoundingBox Object

The SDK provides a BoundingBox object that defines axis-oriented volume in 3D space specified by two diagonal points for the minimum and maximum X, Y, and Z coordinates.

Each graphic object occupies some region of 3D space. You can find out the size of the graphic by using the CalcBoundingBox method of the Graphic. This method returns a BoundingBox object that contains the axis-aligned minimum and maximum points for a volume that encompasses the graphic. The BoundingBox object returned is not owned by the Graphic, but is a copy of the current state of the Graphic. Changing the minimum and maximum points on the BoundingBox will have no effect on the original Graphic.

You can find out the volume of the Graphic for a different coordinate system by supplying a Matrix object as the optional parameter to CalcBoundingBox. The Matrix will be used to temporarily transform the Graphic before doing the bounding box calculation. The transformation is not permanent, and the Graphic object will be in its original position and orientation after the CalcBoundingBox call returns.

Add center and size methods for the BoundingBox object.


Getting the Reference Point of a Graphic

Every Graphic object has a reference point that is used as a basis for performing translation, rotation and scaling operations. The reference point of a Graphic is usually calculated as the center of the Graphic's bounding box, as obtained by the CalcBoundingBox method.

Overriding the reference point.


Moving a Graphic

The Graphic object exposed two methods for moving the graphic from its current location to another.

The Graphic object's MoveRelative method applies a translation operation to the Graphic (and any of its children) according to the X, Y, and Z difference values passed as arguments to it. All the vertices of the graphic and its children are recalculated.

The MoveAbsolute method works with the Graphic object's reference point (usually the center of the graphic's bounding box). MoveAbsolute performs an operation that translates the vertices of the graphics so that after the operation the values of the original reference point's coordinates now will take on the coordinates of the arguments passed to MoveAbsolute. The shape and rotation angle of the Graphic will be unchanged. MoveAbsolute also accepts optional arguments that let you specify the coordinates of a temporary reference point for the move to be used instead of the Graphic's own reference point.

Apparently no way to find out or change (via property) the reference point.

Both MoveRelative and MoveAbsolute return a Matrix object that can be used to replicate the operation. See the topic "Applying Matrix Transformations on a Graphic" for more information.


Rotating a Graphic

The Graphic object's RotateAxis method performs a rotation operation around an axis that you specify. The rotation angle is given in radians, with positive angles meaning a counter-clockwise rotation around the axis (right-hand rule). The three arguments that specify the axis are optional and default to the positive Z axis. The center of rotation is either the Graphic's reference point, or an optional temporary center that you supply as arguments to RotateAxis.

The RotateAbsolute method works with the Graphic object's reference point (usually the center of the graphic's bounding box). You specify the world coordinates of two points: the point to be rotated from, and the point to be rotated to. RotateAbsolute determines the rotation axis by making a cross product of the two vectors that start at the Graphic object's reference point and extend to the two points, calculates the rotation angle between these vectors, and then performs the rotation operation. RotateAbsolute will return an error if the from and to points are collinear with the reference point. RotateAbsolute also accepts optional arguments that let you specify the coordinates of a temporary reference point for the rotation to be used instead of the Graphic's own reference point.

Both RotateAxis and RotateAbsolute return a Matrix object that can be used to replicate the operation. See the topic "Applying Matrix Transformations on a Graphic" for more information.


Scaling a Graphic

You can scale a Graphic object around its reference point (usually the center of the Graphic object's bounding box) or a temporary reference point using the Graphic object's Scale method. You supply scale factors for the X, Y and Z world axes, and an optional temporary reference point for the scaling operation. You can use negative scale factors to perform mirroring operations.

The Scale method returns a Matrix object that can be used to replicate the operation. See the topic "Applying Matrix Transformations on a Graphic" for more information.


Applying Matrix Transformations on a Graphic

In addition to the simple translation, rotation, and scaling operations that the Graphic object supports, you can apply an arbitrary three dimensional affine transformation to a Graphic object through the use of the Graphic object's Transform method. Transform takes a Matrix object as its argument. You can create a Matrix object, set its elements and then pass it to Graphic.Transform to perform the operation:

    Dim gr0 As Graphic
    Dim gr As Graphic
    Dim mtx As Matrix

    Set mtx = New Matrix

    'Set up a pure translation matrix
    'Translation (5, 6, 7)
    mtx.SetEntries _
        1, 0, 0, 0, _
        0, 1, 0, 0, _
        0, 0, 0, 0, _
        5, 6, 7, 1

    Set gr0 = ActiveDrawing.Graphics(0)
    Set gr = gr0.Duplicate
    gr.Transform mtx

The Matrix object is a 4x4 matrix defined in row-major order. You can use the SetEntries method to load the matrix with a list of 16 values, or the SetArray method to load the matrix elements from a one-dimensional Visual Basic array of 16 values, or a two-dimensional 4x4 Visual Basic array. The matrix operates on the three dimensional coordinate system, so the fourth column of values are ignored.


Reshaping Graphic Geometry

Many times you will want to reshape an existing graphic. The most direct way to do this is by modifying the coordinates and number of the vertices that define the graphic, and the properties that control other aspects of the graphic. By reading the documentation on the different graphic subtypes, you can understand the rules for reshaping each type.

Need example


Exploding a Graphic

TurboCAD's user interface includes a utility feature called "Explode" that allows you to break up complex graphic types into simpler pieces. Depending on the type of graphic operated on, the explode operation will produce different results:

Groups are exploded by removing their children from the group, and making them top-level graphics.

Curves, arcs and circles are exploded by converting them to polyline approximations.

Text graphics are exploded by converting them to curves.

Regen graphics have explosion results that vary according to the particular type.


Changing the Drawing Order of a Graphic

If you are working with opaque, two dimensional graphics, you often need to control the order in which graphics are drawn, since graphics drawn later may obscure those drawn previously. You can use the BringToFront method of the Graphic object to move a graphic to the last place in the drawing list, so that it appears "on top" of all the other graphics, or the SendToBack method to move a graphic to the first place in the list, so that it appears "behind" all of the other graphics.

Graphic.ZOrder is unimplemented.


Making Changes to Graphics Undoable

The TurboCAD user interface supports multiple levels of undo through the use of a stack of undo records. When you make changes to the contents of a drawing by creating, destroying or modifying graphics, you should support the ability to undo these changes by using the undo facilities of the SDK.

The UndoRecord object represents a single undoable action in the user interface. The UndoRecord supports the following methods:

UndoRecord Methods
Method | Description
AddGraphic | Add a reference to a newly created Graphic object.
AddGraphicForModify | Add a reference to a Graphic that has been modified.
DeleteGraphic | Add a reference to a Graphic object that is about to be destroyed.
Close | Signal that the current undoable action has been completed, and place the complete undo record on the undo stack.
Delete | Abort the current undoable action. Do not place the undo record on the undo stack.

Many times you will make several changes to the contents of a drawing, creating new graphics and modifying existing graphics as part of an atomic operation. For example you could build a number of graphics to represent a physical part. You could enable the undoing the operation of adding all the graphics representing the part at one time, rather than forcing the user to undo the addition of each graphic. How you structure what is an undoable operation is up to you.


Setting up an Undo Record

Before making an undoable change to one or more graphics, you create an active UndoRecord object by calling the Drawing object's AddUndoRecord method, supplying the text that you want to appear in the Undo menu item.

Dim urec As UndoRecord
Set urec = ActiveDrawing.AddUndoRecord("Add Part")

After the call to AddUndoRecord, you can proceed to create, destroy or modify graphics. The new undo record will not appear in the user interface until it has been completed by another SDK call.


Adding References to the Undo Record

For each graphic that is created, destroyed or modified as part of an undoable action, you must add a reference to the graphic to the undo record that you have set up. The UndoRecord object exposes a method for each of the three actions: create, destroy and modify. When you are adding a new graphic to the drawing as part of an undoable action, you record the addition by using the AddGraphic method:

Dim grNew As Graphic
Set grNew = ActiveDrawing.AddSquare
urec.AddGraphic grNew

If you are just modifying anything (position, color, etc.) in a graphic that already exists as a top-level graphic in the drawing, you record the graphic by using the AddGraphicForModify method. You should only call this method once for each graphic, even though you may make many modifications to the graphic:

Dim grModified As Graphic
Set grModified = ActiveDrawing.Graphics(0)
grModified.Properties("PenColor") = NamedColors("Blue")
grModified.Vertices(0).X = 3
urec.AddGraphicForModify grModified

If you are destroying existing graphics as part of your undoable action, you must add a reference to the graphic to the current undo record before you destroy the graphic, calling the DeleteGraphic method:

Dim grToDestroy As Graphic
Set grToDestroy = ActiveDrawing.Graphics(1)
urec.DeleteGraphic grToDestroy
grToDestroy.Delete
Set grToDestroy = Nothing


Completing or Aborting the Undo Record

When all the changes to the drawing's contents that are part of the undoable action have been finished, you call the Close method of the UndoRecord object to finalize the action and place the undo record on the stack, enabling it in the user interface:

urec.Close
Set urec = Nothing

If there are errors encountered during your undoable action, and you don't want the action to be placed on the undo stack, you use the UndoRecord's Delete method:

urec.Delete
Set urec = Nothing

NOTE If you must abort an undoable action, it is up to you, the programmer, to clean up and restore the contents of the drawing as well as call the UndoRecord Delete method. Take care to Close or Delete every UndoRecord that is created by the AddUndoRecord call. Since UndoRecords are placed on a stack, failure to Close or Delete the active undo record may result in a crash.


Hit Testing a Graphic in 3D Space

Given an arbitrary point in world coordinates, you can find the distance from the closest part of a graphic to the point by using the GetDistance method of the Graphic object. The GetDistance method returns three values: a Vertex object that contains the coordinates of the closest part of the graphic to the given point, a Graphic object that is either the graphic itself or one of its descendants that contains that closest part, and a distance amount from the closest part to the point.

Using the GetDistance method, you can iterate over a collection of graphics to find out which one is closest to a given point.


Basic and Regen Graphics in Detail

ExtendedSelInfo sample to be used to probe graphics

Are there other types that you don't see on this page? I guess I could look at TC rendering or filter source code…

Bitmaps? OleObjects?

Should have Addxxx example for each section.

Should have summary of common and per-subtype properties for each section.


Using 3D Polyline Graphics (Basic)

3D Polylines are defined by the basic GRAPHIC type, with a list of vertices that specify. When you use the Line, 3D Polyline, and Sketch tools, these are the graphics that you create.

What all the vertices mean, creating, modifying, edit node, etc…

The simplest type of visible graphic you can create is a line.

Example: ActiveDrawing.Graphics.AddLine, followed by Extended Sel Info

3D Polyline Graphic Details
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Editable, Visible
Subtype Extended Properties | (none)

All vertices in a 3D Polyline have the same flags. PenUp and PenDown flags can control the visibility of the stroke from one vertex to the next.

3D Polyline Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown or PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: Start or end point of line segment Bulge: False


Using Polygon Graphics (Basic)

Polygons are also just simple objects of type "GRAPHIC". There are two things that set these apart from 3D Polylines: the vertex coordinates must be coplanar, and the the Graphic object must have the Closed standard property set to True. Polygon Graphics are created when you use the Regular Polygon, Irregular Polygon, Rectangle, Rotated Rectangle or Hatch tools in the TurboCAD user interface.

Polygon Graphic Details
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Editable, Visible
Subtype Extended Properties | (none)

For a polygon with N sides, TurboCAD actually builds N+1 vertices. Vertex 0 and vertex N must have the same coordinates:

Polygon Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Start point of line segment Bulge: False
1 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: End point of line segment Bulge: False
N | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: End point of line segment (must be the same as vertex 0) Bulge: False


Using Construction Line Graphics (Basic)

Construction lines are defined as two-vertex GRAPHIC types, with some additional restrictions: The Graphic's Unbounded flag must be set to True, and the Graphic must reside on a predefined layer named "$CONSTRUCTION".

Construction Line Graphic Details
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Editable, Visible, Unbounded
Subtype Extended Properties | Layer = "$CONSTRUCTION"

Both vertices in a construction line have the same flags.

Construction Line Graphic Vertices
Vertex Index | Description
0, 1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Arbitrary points on construction line Bulge: False


Using 2D Polyline Graphics (Regen)

2D Polylines can contain linear or circular arc segments, and are handled by a Regen that builds an approximating curve. 3D Polylines do not allow these "bulge" arc segments.

2D Polyline Graphic Details
Part | Description
Type | TCW50Polyline
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

The following table shows an example of a polyline with three segments: a line segment from vertex 0 to vertex 1, an arc segment from vertices 1 to 4, and another line segment from vertex 4 to 5. Note that for each arc segment in a polyline, two vertices with the Bulge flag are added. The first Bulge vertex is the center point of the arc, and the second Bulge vertex is a control point on the arc, which indicates the direction of the arc.

2D Polyline Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Start point of line segment Bulge: False
1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: End point of line segment Bulge: False
2 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Center point of arc segment Bulge: True
3 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Control point on arc segment Bulge: True
4 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: End point of arc segment Bulge: False
5 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: End point of arc segment Bulge: False

In addition, if there are any arc segments in the polyline, a single cosmetic child graphic will be created that is a continuous approximation polyline with arc segments approximated by a subdivision into straight line segments:

2D Polyline Cosmetic Child Graphic
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

All cosmetic child vertices have the same flags.

2D Polyline Cosmetic Child Vertices
Vertex Index | Description
0 to N | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Start or end point of line segment Bulge: False


Specifying Arc Segments in a Polyline

show example of changing the bulge in a polyline


Using Point Graphics (Regen)

Point Graphic Details
Part | Description
Type | TCW30Point
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

The point graphic subtype has one PenUp vertex, located at the center of the point symbol:

Point Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: Start point of line segment Bulge: False

All point subtypes generate 2 child graphics: a DATA graphic that stores property information, and a cosmetic graphic that renders the outline or symbol.

The Star, Square, and Circle point subtypes' cosmetic graphic is a polygon. The Dot and Cross point subtypes generate

Cosmetic Child Graphic
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Cosmetic, Editable, Visible Closed for Star, Square, and Circle
Subtype Extended Properties | (none)

For the Star, Square and Circle point subtypes, the cosmetic child vertices define a polygon.

Star, Square and Circle Cosmetic Child Vertices
Vertex Index | Description
0 | Flags: PenUp, Selectable X, Y, Z: Start of line segment Bulge: False
1 to N-1 | Flags: PenDown, Selectable X, Y, Z: End point of line segment Bulge: False
N | Flags: PenDown, Selectable X, Y, Z: End point of line segment (must be same as vertex 0) Bulge: False

For the Dot and Cross point subtypes, the cosmetic child vertices define a series of PenUp-PenDown line segments. The Dot subtype generates two vertices at the same location.

Dot and Cross Cosmetic Child 0 Vertices
Vertex Index | Description
0 | Flags: PenUp, Selectable X, Y, Z: Start of line segment Bulge: False
1 | Flags: PenDown, Selectable X, Y, Z: End point of line segment (for Dot: the same as vertex 0) Bulge: False
2 (Cross only) | Flags: PenUp, Selectable X, Y, Z: Start of line segment Bulge: False
3 (Cross only) | Flags: PenDown, Selectable X, Y, Z: End point of line segment Bulge: False


Using Circular Arc, Circle, Elliptical Arc, and Ellipse Graphics (Basic)

Arc, Circle and Ellipse Graphic Details
Part | Description
Type | ARC (for circular or elliptical arc) CIRCLE (for circle or ellipse)
RegenType | (not available)
Normal Flags | BuiltIn, Editable, Visible (for circle or ellipse: also Closed)
Subtype Extended Properties | (none)

An arc, circle or ellipse is defined by exactly 4 vertices:

Arc, Circle and Ellipse Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable, Snappable, Selectable X, Y, Z: Center of arc, circle or ellipse Bulge: False
1 | Flags: PenDown, Editable, Snappable, Selectable X, Y, Z: Start point of arc or circle (for ellipse: point on major axis) Bulge: False
2 | Flags: PenDown, Editable, Snappable, Selectable X, Y, Z: End point of arc or circle (for circle or ellipse: same as vertex 1) Bulge: False
3 | Flags: PenDown, Editable, Snappable, Selectable X, Y, Z: Intermediate point on arc (for arc: arbitrary point to determine arc direction and major/minor ratio) (for circle: quadrant point) (for ellipse: point on minor axis) Bulge: False


Getting Arc Information

Since Arc, Circle and Ellipse Graphics are described by four vertices on the graphic, the SDK provides a convenience method that allows you to get their geometric properties. The Graphic object's GetArcData takes an array of 10 Doubles that you declare as:

Dim arcData(0 To 9) As Double

GetArcData fills the array with the following information:

GetArcData Array
Array Index | Description
0, 1, 2 | X, Y and Z coordinates of arc center
3, 4, 5 | X, Y and Z coordinates of point on arc major axis
6 | Ratio of minor to major axis
7 | Start angle of arc in radians
8 | End angle of arc in radians
9 | 1 if arc is closed, 0 otherwise


Using Construction Circle Graphics (Basic)

Construction circles are just CIRCLE graphics that are constrained to the "$CONSTRUCTION" layer and have the Unbounded flag set to True.

Construction Circle Graphic Details
Part | Description
Type | CIRCLE
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Editable, Visible, Unbounded
Subtype Extended Properties | LAYER = "$CONSTRUCTION"

The vertices for a construction circle graphic are identical to a non-construction circle.


Using Text Graphics (Regen)

Text Graphic Details
Part | Description
Type | TEXT
RegenType | (not available)
Normal Flags | Editable, Visible
Text Graphic Extended Properties
Property | Description
TextMode | Enum: 1 - Standard Text, 2 - Scalable Text, 3 - Flexible Text
Obliquity | Slant angle in degrees for Flexible Text

A text graphic is defined by exactly 6 vertices:

Text Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp X, Y, Z: Justification reference point (i.e. determined by justification settings-left, center, right, top, middle, baseline, bottom) Bulge: False
1 | Flags: PenUp, Linkable, Selectable X, Y, Z: Cell spacing start point (usually at top left of cell rectangle) Bulge: False
2 | Flags: PenDown, Linkable, Selectable X, Y, Z: Bottom left of cell rectangle Bulge: False
3 | Flags: PenDown, Linkable, Selectable X, Y, Z: Bottom right of cell rectangle Bulge: False
4 | Flags: PenDown, Linkable, Selectable X, Y, Z: Top right of cell rectangle Bulge: False
5 | Flags: PenDown, Linkable, Selectable X, Y, Z: Top left of cell rectangle Bulge: False

Note that for flexible text only, there is a single cosmetic graphic which is a sequence of approximating line segments:

Flexible Text Cosmetic Child Graphic
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

Flexible Text Cosmetic Child Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: Start of line segment Bulge: False
1 to N | Flags: PenUp or PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Start or End point of line segment Bulge: False


Using Double Line Graphics (Regen)

A Double Line graphic is much like a simple GRAPHIC polyline, except that the coordinate vertices specify an invisible definition polyline. The actual parallel, drawn line segments are in a single, closed cosmetic child graphic. The Closed flags on the parent graphic is set to True if the double line is a closed polygon (for example, created with the Double Polygon, Double Irregular Polygon, Double Rectangle or Double Rotated Rectangle tools). The rules for double polygons are the same as for single line polygons: the last vertex must be coincident with the first vertex.

Double Line Graphic Details
Part | Description
Type | TCW25DblLine
RegenType | (not available)
Normal Flags | Editable, Visible (for double polygons: also Closed)
Subtype Extended Properties | (none)

A double line graphic is defined by at least 2 vertices:

Double Line Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenUp, Editable, Snappable, Selectable X, Y, Z: Double line definition polyline point Bulge: False

Double lines have 2 children: a DATA graphic and a cosmetic GRAPHIC. Note that the single cosmetic graphic is always flagged as Closed, and that the visibility of its line segments is controlled by the PenUp/PenDown flags on the individual vertices:

Double Line Cosmetic Child Graphic Details
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Editable, Visible, Cosmetic
Subtype Extended Properties | (none)

A double line graphic is defined by at least 2 vertices:

Double Line Cosmetic Child Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenUp or PenDown, Linkable, Snappable, Selectable X, Y, Z: Point on the closed polygon that is drawn. PenUp/PenDown flag controls whether a particular segment is drawn or not Bulge: False


Using Multiline Graphics (Regen)

A Multiline graphic is similar to a simple GRAPHIC polyline, except that the coordinate vertices are specify an invisible definition polyline. The actual parallel, drawn line segments are contained in several cosmetic child graphics, one for each trace of the multiline. The Closed flags on the parent and child graphics are set to True if the multiline is a closed polygon (for example, created with the Multiline Polygon, Multiline Irregular Polygon, Multiline Rectangle, or Multiline Rotated Rectangle tools). The rules for multiline polygons are the same as for single line polygons: the last vertex must be coincident with the first vertex.

Multiline Graphic Details
Part | Description
Type | TC_Multiline
RegenType | (not available)
Normal Flags | Editable, Visible (for polygons: also Closed)
Subtype Extended Properties | (none)

A multiline graphic is defined by at least 2 vertices:

Multiline Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Multiline definition polyline point Bulge: False

Multilines have a child DATA graphic that contains the properties, and one cosmetic GRAPHIC for each trace of the multilane. A triple line, for example, will have the DATA graphic and 3 child cosmetic GRAPHICs.

Multiline Cosmetic Child Graphic Details
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Editable, Visible, Cosmetic (for polygons: also Closed)
Subtype Extended Properties | (none)

The multline cosmetic graphic is defined by at least 2 vertices:

Multiline Cosmetic Child Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenUp or PenDown, Linkable, Snappable, Selectable X, Y, Z: Point on the polyline or polygon that is drawn. PenUp/PenDown flag controls whether a particular segment is drawn or not Bulge: False


Using Spline Curve Graphics (Regen)

The TurboCAD Spline curve is a continous cubic spline, defined by a minimum of three control points. Each Spline is defined by start and end points on the curve, and at least one intermediate control point. All intermediate control points are off-curve points.

The parent Spline curve graphic has two children: a DATA graphic that contains property information, and a cosmetic GRAPHIC that contains the approximating polyline to the curve. The child cosmetic is just a simple 3D Polyline type.

Spline Curve Graphic Details
Part | Description
Type | TCW30CURVE
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A curve graphic is defined by at least 3 vertices:

Spline Curve Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Snappable X, Y, Z: On-curve point at start of curve Bulge: False
1 to N-2 | Flags: PenUp, Editable X, Y, Z: Off-curve control point Bulge: False
N-1 | Flags: PenUp, Editable, Snappable X, Y, Z: On-curve point at end of curve Bulge: False


Using Bezier Curve Graphics (Regen)

The Bezier curve is a piecewise cubic curve, in which each piece is defined by four control points, a start and end point on the curve, and two intermediate off-curve control points. Therefore, the shortest Bezier curve has four vertices, one with two connected pieces has seven vertices (since the middle on-curve control point is shared between both pieces), etc.

The parent Bezier curve graphic has two children: a DATA graphic that contains property information, and a cosmetic GRAPHIC that contains the approximating polyline to the curve.

Bezier Curve Graphic Details
Part | Description
Type | TCW30CURVE
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A curve graphic is defined by at least 4 vertices:

Spline Curve Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Snappable X, Y, Z: On-curve point at start of curve Bulge: False
1, 4, … | Flags: PenUp, Calculated, Editable X, Y, Z: Off-curve control point (tied to previous on-curve point) Bulge: False
2, 5, … | Flags: PenUp, Calculated, Editable X, Y, Z: Off-curve control point (tied to next on-curve point) Bulge: False
3, 6, … | Flags: PenUp, Editable X, Y, Z: On-curve point Bulge: False
N-1 | Flags: PenUp, Editable, Snappable X, Y, Z: On-curve point at end of curve Bulge: False

The curve graphic has two children: a DATA graphic that contains property information, and a cosmetic GRAPHIC that contains the approximating polyline to the curve.


About Dimension and Leader Graphics

Dimensions and leaders all use the same basic mechanism to define and draw themselves. They combine polylines, arrowheads and text.

Add more examples here.


Using Linear Dimension Graphics (Regen)

The Linear Dimension regen also handles Baseline, Continuous and Incremental types of dimensions.

Linear Dimension Graphic Details
Part | Description
Type | TCW25DimLin
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A linear dimension graphic is defined by exactly 6 vertices:

Linear Dimension Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp X, Y, Z: Origin Bulge: False
1 | Flags: PenUp, Editable, Linkable X, Y, Z: Virtual point on first extension line Bulge: False
2 | Flags: PenUp, Editable, Linkable X, Y, Z: Virtual point on second extension line Bulge: False
3 | Flags: PenUp, Editable X, Y, Z: Intersection of first extension line with dimension string line Bulge: False
4 | Flags: PenUp, Editable, Selectable X, Y, Z: Actual location of dimension text Bulge: False
5 | Flags: PenUp X, Y, Z: Original location of dimension text Bulge: False

The linear dimension graphic has 10 child graphics: a DATA graphic containing the properties, 2 GRAPHIC extension lines, 2 GRAPHIC polyline cosmetic children that draw each half of the dimension line, 2 GRAPHIC arrowhead cosmetic children, and 3 TEXT cosmetic children for the parts of the dimension text: number, tolerance and units.


Using Angular Dimension Graphics (Regen)

Angular Dimension Graphic Details
Part | Description
Type | TCW25DimAng
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

An angular dimension graphic is defined by exactly 6 vertices:

Angular Dimension Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Linkable X, Y, Z: Center of arc or circle Bulge: False
1 | Flags: PenUp, Editable, Linkable X, Y, Z: Virtual point on first extension line Bulge: False
2 | Flags: PenUp, Editable, Linkable X, Y, Z: Virtual point on second extension line Bulge: False
3 | Flags: PenUp, Editable X, Y, Z: Arbitrary point on dimension arc Bulge: False
4 | Flags: PenUp, Editable, Selectable X, Y, Z: Actual location of dimension text Bulge: False
5 | Flags: PenUp X, Y, Z: Original location of dimension text Bulge: False

The angular dimension graphic has 10 child graphics: a DATA graphic containing the properties, 2 GRAPHIC extension lines, 2 ARC cosmetic children that draw each half of the dimension arc, 2 GRAPHIC arrowhead cosmetic children, and 3 TEXT cosmetic children for the parts of the dimension text: number, tolerance and units.


Using Radial and Diameter Dimension Graphics (Regen)

Radial Dimension Graphic Details
Part | Description
Type | TCW25DimRad (radial) or TCW25DimDia (diameter)
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A radial dimension graphic is defined by exactly 5 vertices:

Radial Dimension Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Linkable, Selectable X, Y, Z: Center of arc or circle Bulge: False
1 | Flags: PenUp, Editable, Linkable, Selectable X, Y, Z: Intersection of radial line with arc or circle Bulge: False
2 | Flags: PenUp, Editable, Snappable, Selectable X, Y, Z: End of radial line Bulge: False
3 | Flags: PenUp X, Y, Z: Original location of dimension text Bulge: False
4 | Flags: PenUp, Editable, Snappable, Selectable X, Y, Z: Actual location of dimension text Bulge: False

The radial dimension graphic has 8 child graphics: a DATA graphic containing the properties, 1 GRAPHIC cosmetic child that draws the interior, exterior and leader parts, 2 GRAPHIC arrowhead cosmetic children (one of which can be degenerate for the radial dimension), 1 GRAPHIC cosmetic child that draws the center point, and 3 TEXT cosmetic children for the parts of the dimension text: number, tolerance and units.


Using Datum Dimension Graphics (Regen)

Datum Dimension Graphic Details
Part | Description
Type | TCW25DimDat
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A datum dimension graphic is defined by exactly 3 vertices:

Datum Dimension Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Linkable X, Y, Z: Origin Bulge: False
1 | Flags: PenUp, Editable, Linkable X, Y, Z: Virtual point: datum point Bulge: False
2 | Flags: PenUp, Editable, Linkable X, Y, Z: Virtual point: text line Bulge: False

The datum dimension graphic has 6 child graphics: a DATA graphic containing the properties, 2 GRAPHIC cosmetic children that define the datum polyline and arrow head, and 3 TEXT cosmetic children for the parts of the dimension text: number, tolerance and units.


Using Leader Graphics (Regen)

Leader Graphic Details
Part | Description
Type | TCW25DimLead
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A leader is defined by two vertices that locate the leader text, followed by N-3 vertices that define the leader polyline:

Leader Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable X, Y, Z: Origin (text) Bulge: False
1 | Flags: PenUp X, Y, Z: Origin (text) Bulge: False
2 | Flags: PenUp, Editable, Linkable X, Y, Z: Start point of leader line (arrowhead location) Bulge: False
3 to N-1 | Flags: PenUp, Editable X, Y, Z: Start and end points of leader line segments Bulge: False

The leader graphic has 4 child graphics: a DATA graphic containing the properties, one GRAPHIC cosmetic child that defines the leader polyline, one GRAPHIC cosmetic child that draws the arrow head, and the TEXT cosmetic child that draws the leader text.


Using Wall Graphics (Regen)

Wall graphics are a 2D type that has additional intelligence. Walls are built up from linked segments, each of which is defined by a single top-level Wall graphic.

To be continued; I have no idea of how these work…

Wall Graphic Details
Part | Description
Type | TCW60Wall
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

Each wall graphic (segment) is defined by exactly 2 vertices:

Wall Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Snappable, Selectable X, Y, Z: First definition point for wall Bulge: False
1 | Flags: PenUp, Editable, Snappable, Selectable X, Y, Z: Second definition point for wall Bulge: False

The parent Wall graphic has at least three children, a DATA graphic containing the Wall segment properties, one or more non-cosmetic GRAPHIC named "Gap" that define how the Wall graphic intersects other wall graphics, and a cosmetic child that draws the result.

Wall Gap Non-Cosmetic Child Graphic
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Cosmetic, Editable, Visible
Subtype Extended Properties | Name = "Gap"

Gap graphics always contain exactly five vertices:

Need info on these.

Wall Gap Non-Cosmetic Child Vertices
Vertex Index | Description
0 | Flags: PenUp X, Y, Z: Start of line segment Bulge: False
1 | Flags: PenDown X, Y, Z: Start of line segment Bulge: False
2 | Flags: PenUp X, Y, Z: Start of line segment Bulge: False
3 | Flags: PenDown X, Y, Z: Start of line segment Bulge: False
4 | Flags: PenUp X, Y, Z: Start of line segment Bulge: False

In addition wall segments that are part of a continuously drawn wall can have non-cosmetic GRAPHICs named "Start" and "End" (0 or one Start GRAPHICs and 0 or one End Graphics may be present). These children define the starting and ending points for the two faces of the wall.

Wall Start or End Non-Cosmetic Child Graphic
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Cosmetic, Editable, Visible
Subtype Extended Properties Name = "Start" for start graphic
Name = "End" for end graphic

Start or End graphics always contain exactly two vertices:

Wall Start or End Non-Cosmetic Child Vertices
Vertex Index | Description
0 | Flags: PenUp X, Y, Z: Start or end of one wall face Bulge: False
1 | Flags: PenUp X, Y, Z: Start or end of other wall face Bulge: False


About Surface Graphics

3D solids and surfaces in TurboCAD can be defined as a polygonal mesh or using the ACIS geometry engine. The Surface graphic type represents the polygonal mesh representation.

Surface Graphic Details
Part | Description
Type | SURFACE
RegenType | (not available)
Normal Flags | Builtin, Editable, Visible
Subtype Extended Properties | (none)

Vertices for the mesh are all specified the same way. The internal properties of the SURFACE graphic describe how the mesh vertices are connected.

Surface Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Vertex of the surface mesh Bulge: False

To change the topology of the mesh that defines the Surface graphic (by inserting or removing vertices and edges), you must access the mesh-defining properties through an object model.

Discuss use of Edges, Contours.


Getting Mesh Face Data

Two convenience methods in the Graphic object provide access to the topology of SURFACE and 3DMESH graphic types.

GetFaceDimension

You can use the GetFaceDimension method of the Graphic object to obtain the overall size of the mesh. GetFaceDimension fills its M and N arguments with the rectangular size of the 3DMESH (number of rows and columns in the mesh), and its facetCount argument with the number of faces of the SURFACE or 3DMESH graphic.

GetFaceData

You can use the GetFaceData method of the Graphic object to obtain information on the mesh that defines a SURFACE or 3DMESH graphic type. You supply three undimensioned arrays to GetFaceData, dimensioned as follows:

Dim vtxCoords() As Double 'vertex coordinate array
Dim vtxIndices() As Long 'face vertex index array
Dim edgeFlags() As Long 'face edge flag array

After GetFaceData returns, these arrays will be filled with the mesh topology. Each array will be resized to hold the data. The vertex coordinates array will contain the X, Y, and Z coordinates of the vertices that define the surface or 3D mesh. The face vertex index array will contain a sequence of indices into the vertex coordinate array that define all the faces of the surface or mesh. Each face is defined by a sequence of non-negative index values (3 or 4 depending on the type of mesh), followed by a -1 value indicating the closure of the face. The index values are coordinate indices; they must be multiplied by three to obtain the actual index to be used for the vertex coordinate array, which consists of triplets of X, Y, and Z values. The face edge flag array can be read in parallel with the face vertex index array. Each value in the array is either 0 or 1, 1 representing a visible edge, and 0 representing an invisible edge.

Show example of use


About ACIS Solid Graphics

3D solids and surfaces in TurboCAD can be defined as a polygonal mesh or using the ACIS geometry engine. ACIS provides a very high level of geometrical precision to mathematically define a variety of 3D solid types. ACIS solids are created as cosmetic children when you construct any of the basic TurboCAD 3D solid graphics (Box, Prism, Polygonal Prism, Sphere, Hemisphere, Cylinder, Cone, Torus, Extrusion, Revolution, Wedge, 3D Mesh). They are also created as top-level graphic objects when you use any of the 3D Boolean tools.

When you use one of the 3D solid creation tools, you will create a graphics hierarchy that looks something like this:

Insert figure here.

The DATA graphic at the child level contain data specific for each type of solid. The DATA graphic at the grandchild level contains data used by the ACIS engine, including the geometry definition. The ACIS Solid child graphic has no vertices itself, since it is defined completely by the grandchild DATA graphic's information. However, to allow for display, the ACIS Solid regen tessellates its geometry into a SURFACE graphic. This polygonal mesh graphic is what is used to approximate the geometry for the purposes of rendering materials.

When you use one of the 3D Boolean operations, your hierarchy will look like this:

Insert figure here.


Using 3D Box Graphics (Regen)

Box Graphic Details
Part | Description
Type | TCW40CUBE
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A box graphic is defined by exactly 4 vertices:

Box Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: Origin of box (one corner) Bulge: False
1 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: First axis of box base Bulge: False
2 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: Second axis of box base Bulge: False
3 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: Third axis of box (Z axis) Bulge: False

A box graphic has two direct child graphics, a DATA graphic that holds the box properties, and a TCW60ACISSOLID cosmetic graphic:

Box ACIS Solid Cosmetic Child Graphic
Part | Description
Type | TCW60ACISSOLID
RegenType | (not available)
Normal Flags | Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The ACIS Solid has no vertices itself, but has two children (grandchildren of the original box graphic): a DATA graphic that holds ACIS information and a SURFACE cosmetic graphic:

Box ACIS Solid Surface Cosmetic Child Graphic
Part | Description
Type | SURFACE
RegenType | (not available)
Normal Flags | Builtin, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The surface has 24 vertices that describe the faces of the box:

Box ACIS Solid Surface Cosmetic Child Vertices
Vertex Index | Description
0 to 23 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Vertex of box face. Coordinates are defined relative to the center of the box. Bulge: False


Using 3D Sphere Graphics (Regen)

Sphere graphics are created using the Sphere and Hemisphere tools.

Sphere Graphic Details
Part | Description
Type | TCW40SPHERE
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A sphere graphic is defined by exactly 2 vertices:

Sphere Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: Center of sphere Bulge: False
1 | Flags: PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: Point on sphere (Z axis) Bulge: False

A sphere graphic has two direct child graphics, a DATA graphic that holds the sphere properties, and a TCW60ACISSOLID cosmetic graphic:

Sphere ACIS Solid Cosmetic Child Graphic
Part | Description
Type | TCW60ACISSOLID
RegenType | (not available)
Normal Flags | Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The ACIS Solid has no vertices itself, but has two children (grandchildren of the original sphere graphic): a DATA graphic that holds ACIS information and a SURFACE cosmetic graphic:

Sphere ACIS Solid Surface Cosmetic Child Graphic
Part | Description
Type | SURFACE
RegenType | (not available)
Normal Flags | Builtin, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The surface has vertices that describe the faces of the sphere's tessellation. The number of these vertices varies depending on the longitudinal/latitudinal section properties:

Sphere ACIS Solid Surface Cosmetic Child Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Vertex of sphere face. Coordinates are defined relative to the center of the sphere. Bulge: False


Using 3D Extrude Graphics (Regen)

Extrude graphics are created when you use the Extrude, Cylinder, or Wedge tools in the TurboCAD user interface.

Extrude Graphic Details
Part | Description
Type | TCW40EXTRUDE
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

An extrude graphic is defined by three or more vertices. The first two vertices define the starting point and plane of the base. Each successive vertex defines a segment of the extrusion process:

Extrude Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: Origin of extrusion Bulge: False
1 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: Base axis Bulge: False
2 to N-1 | Flags: PenUp, Linkable, Snappable, Selectable X, Y, Z: Segment axis Bulge: False

An extrude graphic has three direct child graphics, a DATA graphic that holds the extrude properties, a child non-cosmetic GRAPHIC that defines the polgyon path that is extruded, and a TCW60ACISSOLID cosmetic graphic:

Extrude Polygon Non-Cosmetic Child Graphic
Part | Description
Type | GRAPHIC
RegenType | (not available)
Normal Flags | BuiltIn. Closed Editable, Visible
Subtype Extended Properties | (none)

See information on polygons for the definition of this child's vertices.

Extrude ACIS Solid Cosmetic Child Graphic
Part | Description
Type | TCW60ACISSOLID
RegenType | (not available)
Normal Flags | Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The ACIS Solid has no vertices itself, but has two children (grandchildren of the original extrude graphic): a DATA graphic that holds ACIS information and a SURFACE cosmetic graphic:

Extrude ACIS Solid Surface Cosmetic Child Graphic
Part | Description
Type | SURFACE
RegenType | (not available)
Normal Flags | Builtin, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The surface has vertices that describe the faces of the extrusion's tessellation. The number of these vertices varies depending on the geometry of the extrusion:

Extrude ACIS Solid Surface Cosmetic Child Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Vertex of sphere face. Coordinates are defined relative to the center of the sphere. Bulge: False


Using 3D Revolution Graphics (Regen)

Solids and surfaces of revolution are geometries defined by taking a 2D polyline or polygon and rotating it about an axis. Revolutions are created when you use the Revolve or Torus tools in TurboCAD. The parent revolution graphic specifies the center and axis of rotation. The revolved geometry is defined by a non-cosmetic child graphic.

Revolution Graphic Details
Part | Description
Type | TCW40SPIN
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

The revolution parent graphic contains exactly two vertices that define the axis of rotation:

Revolution Graphic Vertices
Vertex Index | Description
0 | Flags: PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: First point on axis of revolution Bulge: False
1 | Flags: PenUp, Editable, Linkable, Snappable, Selectable X, Y, Z: Second point on axis of revolution Bulge: False

A revolution graphic has three direct child graphics, a DATA graphic that holds the loft properties, a child non-cosmetic GRAPHIC or CIRCLE that define the polygon or circle that is being revolved, and a TCW60ACISSOLID cosmetic graphic. The non-cosmetic graphic is a CIRCLE in the case of a torus, and can be any polyline, arc, or polygon in the more general case. The coordinates of the revolved graphic are specified in the same world coordinate system as the axis of revolution.

Revolution ACIS Solid Cosmetic Child Graphic
Part | Description
Type | TCW60ACISSOLID
RegenType | (not available)
Normal Flags | Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The ACIS Solid has no vertices itself, but has two children (grandchildren of the original loft graphic): a DATA graphic that holds ACIS information and a SURFACE cosmetic graphic:

Revolution ACIS Solid Surface Cosmetic Child Graphic
Part | Description
Type | SURFACE
RegenType | (not available)
Normal Flags | Builtin, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The surface has vertices that describe the faces of the revolution's tessellation. The number of these vertices varies depending on the geometry of the revolution graphic.

Revolution ACIS Solid Surface Cosmetic Child Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Vertex of sphere face. Coordinates are defined relative to the center of the sphere. Bulge: False


Using 3D Loft Graphics (Regen)

Loft graphics are 3D interpolations between two or more 2D graphics. Lofts are created when you use the Cone, Prism or Loft tools in TurboCAD. The parent loft graphic has no vertices itself. Its geometry is completely defined by the non-cosmetic child graphics that the loft operation interpolates.

Loft Graphic Details
Part | Description
Type | TCW40LOFT
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

A loft graphic has four direct child graphics, a DATA graphic that holds the loft properties, two child non-cosmetic graphics that define the circles or polgyons that are the edges of the loft operation, and a TCW60ACISSOLID cosmetic graphic. For the Cone, one of the non-cosmetic graphics is a CIRCLE, and the other is a GRAPHIC with just one vertex. In the more general case, the two non-csometic graphics are just general polygons.

Loft ACIS Solid Cosmetic Child Graphic
Part | Description
Type | TCW60ACISSOLID
RegenType | (not available)
Normal Flags | Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The ACIS Solid has no vertices itself, but has two children (grandchildren of the original loft graphic): a DATA graphic that holds ACIS information and a SURFACE cosmetic graphic:

Loft ACIS Solid Surface Cosmetic Child Graphic
Part | Description
Type | SURFACE
RegenType | (not available)
Normal Flags | Builtin, Cosmetic, Editable, Visible
Subtype Extended Properties | (none)

The surface has vertices that describe the faces of the loft's tessellation. The number of these vertices varies depending on the geometry of the loft:

Loft ACIS Solid Surface Cosmetic Child Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Vertex of sphere face. Coordinates are defined relative to the center of the sphere. Bulge: False


Using 3D Mesh Graphics (Regen)

The 3D Mesh Graphic is defined by a rectangular grid of vertices.

3D Mesh Graphic Details
Part | Description
Type | 3DMESH
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

The 3D mesh vertices are specified in row major order. So for a mesh with m rows and n columns, the vertices are listed as N(1, 1), N(1, 2), N(1, n), N(2, 1), … N(m, n).

3D Mesh Graphic Vertices
Vertex Index | Description
0 to N-1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Point on mesh Bulge: False

There is only one child of the 3DMESH parent, a DATA graphic that contains the mesh properties.


Using Region Graphics (Regen)

Region graphics are created when you use the 2D Boolean tools to combine 2 2D graphics. The Region parent graphic has no vertices, since it is fully composed of the two non-cosmetic child graphics and an operation type.

Region Graphic Details
Part | Description
Type | TCW70Region
RegenType | (not available)
Normal Flags | Editable, Visible
Subtype Extended Properties | (none)

The parent Region graphic always has exactly 4 children: a DATA graphic containing the properties (including the operation type), and the two child non-cosmetic graphics that were used as parameters to the operation, and a cosmetic polygon GRAPHIC that is the visible result of the operation. Note that 2D Boolean operations can be nested (you can make a Region by combining already existing Regions), and that these nested cosmetic child graphics are retained in the hierarchy.


Using Camera Graphics (Regen)

The Camera Graphic is defined by two vertices that specify the position and orientation. You add a Camera graphic by using the Insert Camera menu command.

Camera Graphic Details
Part | Description
Type | TCCamera
RegenType | (not available)
Normal Flags | Editable, Visible, Unbounded
Subtype Extended Properties | (none)

These don't appear to do anything!

Camera Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable, Linkable X, Y, Z: Location of camera Bulge: False
1 | Flags: PenDown, Editable, Linkable X, Y, Z: Point on axis of camera direction Bulge: False

Each Camera graphic has two children: a DATA graphic that holds property information, and a SURFACE cosmetic child graphic.


Using Light Graphics (Regen)

The Light Graphic is defined by two vertices that specify the position and orientation. You can add a Light graphic when you use the Ambient Light, Point Light, Directional Light, Headlight Light, or Spot Light tools.

Light Graphic Details
Part | Description
Type | TCLight
RegenType | (not available)
Normal Flags | Editable, Visible, Unbounded
Subtype Extended Properties | (none)

These don't appear to do anything!

Light Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable, Linkable X, Y, Z: Location of light Bulge: False
1 | Flags: PenDown, Editable, Linkable X, Y, Z: Point on axis of light direction Bulge: False

Each Light graphic has five children: 2 DATA graphics that hold property information, 2 SURFACE cosmetic child graphics that are used to render the light in three dimensions, and a GRAPHIC cosmetic child for drawing parts of the light when it's selected.


Using Block Insertion Graphics (Basic)

An Insert graphic is used to place an instance of geometry defined by a Block. The insert contains a reference point and a matrix that defines where the Block's geometry will be located.

In TurboCAD the insert's matrix is specified by the location of 4 vertices. The insertion transformation matrix can be calculated directly from the coordinates of the 4 vertices and vice versa.

Insert formulas here.

Block Insertion Graphic Details
Part | Description
Type | INSERT
RegenType | (not available)
Normal Flags | BuiltIn, Editable, Visible
Subtype Extended Properties | (none)

An block insertion graphic is defined by exactly 4 vertices that are used to create a 4 x 3 transformation matrix that TurboCAD uses to calculate the position, orientation and scaling transformation that is applied to the block definition.

Block Insertion Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Insertion point of block reference, defines translation matrix row Bulge: False
1 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Defines matrix row (calculated as X, Y, Z difference from vertex 0) Bulge: False
2 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Defines matrix row (calculated as X, Y, Z difference from vertex 0) Bulge: False
3 | Flags: PenDown, Editable, Linkable, Snappable, Selectable X, Y, Z: Defines matrix row (calculated as X, Y, Z difference from vertex 0) Bulge: False

Show matrix math, derived from these vertices and the Block's Anchor vertex.


Exploding a Block Insertion

When you explode block insertion graphics with the Explode method, the Graphic objects that are contained by the reference Block object are copied to the Drawing's Graphics collection.

Is a group created?


Using Viewport Graphics

Viewports define polygonal regions (usually in PaperSpace) that refer to a Named View on the drawing's contents. Viewport Graphics are created when you use the Insert Viewport menu command. They are very similar to 2D polygons in their content:

Viewport Graphic Details
Part | Description
Type | VIEWPORT
RegenType | (not available)
Normal Flags | BuiltIn, Closed, Editable, Visible
Viewport Graphic Extended Properties
Property | Description
NamedView | String: name of NamedView in the drawing that provides zoom information to the viewport.

For a viewport polygon with N sides, TurboCAD actually builds N+1 vertices. Vertex 0 and vertex N must have the same coordinates. Most viewports are standard rectangles with 5 vertices:

Viewport Graphic Vertices
Vertex Index | Description
0 | Flags: PenDown, Editable X, Y, Z: Start point of line segment Bulge: False
1 to N-1 | Flags: PenDown, Linkable, Snappable, Selectable X, Y, Z: End point of line segment Bulge: False
N | Flags: PenDown, Linkable, Snappable, Selectable X, Y, Z: End point of line segment (must be the same as vertex 0) Bulge: False


Using The View Object

You use the View object primarily to display portions of a TurboCAD drawing in a region of a window, to print a drawing, or to control the rendering of an object. By modifying a View's properties, you can control the position and zoom of the view, and whether the View is in paper space or model space. You can perform projection transformations to convert from 2D or 3D world coordinates to 2D screen coordinates and vice versa. You can also use the View object to find out what Graphic entities are located in the vicinity of a specified point or area in a TurboCAD drawing use the View object's PickResult collection. Typically the PickResult collection is used to analyze Graphic objects at the point of mouse click.

The View object represents an abstract concept of a particular projection of part of a 2D or 3D scene onto a 2D display surface. The View object itself does not create this display surface; instead it attaches to already created surfaces through the View properties HWND (to attach to a window handle) and DC (to attach to a Windows device context, which can be either a screen display device, printer, or graphics memory).

Note Since VBA does not allow to directly access hWnd and hDC properties of an object, to display a TurboCAD drawing in a VBA form you need to create an ActiveX control with necessary properties and place it on a form.


What's in a View?

The View object exposes a number of properties and methods that can be used to manipulate and/or customize the View object. The below list shows the most typically used properties and methods of the View object:

View Standard Properties
Property | Description
DC | Returns or sets the DC (device context) associated with this View object. Read-Write.
HWND | The HWND value of the View object's display Window. Read-Write.
ScreenLeft, ScreenTop, ScreenWidth, ScreenHeight | ScreenLeft: X coordinate of the left-hand side of the View object's screen space. Read-Write. ScreenTop: Y coordinate of the top of the View object's screen space. Read-Write. ScreenWidth: width the View object's screen space. Read-Write. ScreenHeight: height the View object's screen space. Read-Write.
ViewLeft, ViewTop, ViewWidth, ViewHeight | ViewLeft: X coordinate of the left-hand side of the View object's view space. Read-Write. ViewTop: Y coordinate of the top of the View object's view space. Read-Write. ViewWidth: width of the View object's view space. Read-Write. ViewHeight: height of the View object's view space. Read-Write.
CenterOnExtents | Converges the center of the View rectangle (set by ViewLeft, ViewTop, ViewWidth, ViewHeight properties) with the center of the screen rectangle (set by ScreenLeft, ScreenTop, ScreenWidth, ScreenHeight properties). Read-Write.
FixedAspectRatio | Returns or sets the View object's mapping to isotropic or anisotropic. Read-Write.
MappingMode | Returns or sets the mapping mode (screen measurement units, e.g. pixels) of the View object's associated device context. Read-Write.
Update | Specifies whether changes to parameters of the View object are immediately reflected. Read-Write.
SpaceMode | Returns or sets Drawing's space (Model Space or Paper Space) represented by the View. Read-Write.
RenderView | Returns the RenderView object that controls the View object. Read-Only.
ExternalView | Boolean: Returns a flag that tells whether an external 3D rendering process is controlling the View object.

View Methods
Method | Description
Delete | Deletes the View object.
Refresh | Causes repaint of a Drawing or any part of a Drawing associated with this View object according to the View's current settings.
ZoomToExtents | Sets the View object's extents (boundaries) to fit a drawing into extents of a window or DC (device context).
OpenBitmapDC | Opens and returns a DC (device context) to output View to a memory bitmap.
CloseBitmapDC | Closes the bitmap DC and returns the bitmap handle.
OpenMetafileDC | Opens a DC (device context) for Windows metafile drawing.
CloseMetafileDC | Closes the Windows metafile DC and returns a metafile handle.
GetMouseClick | Returns mouse point coordinates in the View's view space coordinate system.
PickPoint | Returns PickResult object that describes Graphic objects at specified point in the View's view space coordinate system.
ScreenToView | Converts screen space coordinates to the View's view space coordinates.
ViewToScreen | Converts the View's view space coordinates to screen space coordinates.
WorldToView | Converts world space coordinates to the View's view space coordinates.
ViewToWorld | Converts the View's view space coordinates to world space coordinates.


Using View Objects with VBA

When you open a new drawing project in TurboCAD a default View is automatically created, i.e. the Views collection of a TurboCAD drawing is not empty. You access a View object in your VBA project through the Views collection of a Drawing object:

Dim vw As IMSIGX.View
Set vw = ActiveDrawing.Views(0)

The currently active View (the one that has the input focus, in the foreground window) can also be accessed via the ActiveView property of the TurboCAD Drawing object:

Set vw As IMISGX.View
Set vw = ActiveDrawing.ActiveView

Having obtained a View object you can use the Refresh and ZoomToExtents methods to redraw the contents of the drawing within the view. When you are manipulating a built-in TurboCAD view you don't have to clear the TurboCAD window prior to calling redraw functions, the window will be cleared automatically.

You can also use the View Object's PickResult collection to determine which object was selected in a drawing.


Creating a View Without Specifying Context

In VBA, you can add a View to a Drawing if you need to perform object selection or create bitmaps or metafiles, and you don't want to use TurboCAD's predefined Views.

A new View is added to the Views collection by the Add method:

ActiveDrawing.Views.Add

If you use the Add method without parameters it will create an empty (uninitialized) View not associated with the drawing's window or a device context. It means you will have to manually set either hWnd or hDC properties for this View's to associate it with a window or with a device, as well set other required View properties.

You can also use OpenBitmapDC or OpenMetafileDC methods for such View to associate it with respective device context.


Creating a View Attached to a Window

If you want your new View to draw within the client area of an existing window, you supply the handle (hWnd property) of the existing window in the call to Views.Add:

Dim hWnd As Long
'Get hWnd value from somewhere
Dim vw As View
Set vw = ActiveDrawing.Views.Add(hWnd)

NOTE If you call the Views.Add method with both optional parameters (hWnd and hDC), the hDC parameter is ignored and only hWnd is used.

To specify hWnd parameter for the Add method you need an object that supports hWnd property. For instance, some Visual Basic object types that support hWnd are the UserForm, UserControl, and Frame objects.

In VBA you can obtain the hWnd by using calls to the Windows API. For instance, to get the hWnd of a UserForm, you can call the Windows API function FindWindow:

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
  (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
'Pass the text of the window caption to the FindWindow function
Dim hWnd As Long
hWnd = FindWindow(vbNullString, UserForm1.Caption)

If you use Add method with hWnd parameter, the View object you create will have its screen rectangle properties (ScreenWidth, ScreenHeight, ScreenLeft, and ScreenTop) set to the client area of the specified window. If you want to restrict the drawing area of the view to a smaller rectangle within the window, you can change these values to reflect the sub-rectangle, specified in client pixel coordinates. Normally, you only need to adjust the View's ViewLeft, ViewTop, ViewWidth, ViewHeight properties to reflect the part of the world you wish to display in the view. This can easily be done using ZoomToExtents method:

sample code to set up a new view

The Camera VBA sample gives an example of how to draw on a UserForm.


Creating a View Attached to a Device Context

If you want your new View to draw onto an existing Windows device context, you supply the handle (hDC property) of the device context in the call to Views.Add:

Dim hDC As Long
'Get hDC value from somewhere
Dim vw As View
Set vw = ActiveDrawing.Views.Add(, hDC)

NOTE If you call the Views.Add method with both optional parameters (hWnd and hDC), the hDC parameter is ignored and only hWnd is used.

To specify hDC parameter for the Add method you need an object that supports hDC property. In Visual Basic, the Printer object or the Image control's Picture object can supply an hDC.

After you create a View object using the hDC parameter you must set all of the screen and view rectangle properties for the new View object, in order to tell the View object where to draw within the device context. In addition, you must also set the View's MappingMode property to the correct Windows API setting. The MappingMode determines the coordinate system, scaling and vertical orientation for the device context. The normal setting to use for most device contexts is MM_TEXT (3).


Setting Up A Newly Created View

After you create a new view, you usually set several View object properties to control how the view will respond to zoom and camera changes. You usually set the FixedAspectRatio to True to ensure that X and Y scaling will be synchronized (so that the objects you draw won't appear stretched in one direction or the other). You also can set the CenteredOnExtents property to True to place the objects you draw at the center of the screen rectangle rather than at the top left corner.


Reassigning Views to Windows or Device Contexts

You can change HWND and DC properties of already existing Views. However, at each given time a View can set only one property of the two: either HWND or DC. In other words, you can't use HWND and DC properties simultaneously, e.g. you can't simultaneously output a View to a window and a memory bitmap.

You can associate several Views with one hWnd, yet it is not recommended to do the same with hDC. One hDC ought to be associated with one View object only.


Destroying a View

If you have previously created your own View object by adding a View to the Views collection with or without specifying a context for the View, you can destroy it using Delete method.

WARNING Do not delete any intrinsic View objects created by TurboCAD. Removing an intrinsic View will result in a TurboCAD application crash. Attempting to delete a non-existent View object causes a run-time error.

The Delete method releases memory allocated by TurboCAD to store the View structure. However, memory used by a VBA object encapsulating the View is not released. To completely destroy a View object you must make sure to destroy the object variable holding the View object:

vw.Delete
Set vw = Nothing

As a developer you are also responsible for destroying the window (hWnd) or device context (hDC) that the View was using, if necessary. Do not destroy these objects while a related View object still exists, it might cause undesirable results including system crash.


Accessing a Drawing's Views Collection

A View object is responsible for displaying a drawing in a window or for outputting a drawing to any output device. A drawing may have any number of views. To access and manipulate a drawing's views use Views collection. The following example prints the total number of all Views in the active drawing:

Debug.Print "Number of views in this drawing is " & ActiveDrawing.Views.Count


Accessing the Active View

The ActiveView is the window of a drawing that currently has the focus. To access the ActiveView object use the Drawing's object ActiveView property:

Dim vw as View
Set vw = ActiveDrawing.ActiveView

Should we have View.Active readonly property?


Redrawing a View

Any time you want to force a View object to redraw its contents, you can use the Refresh method:

vw.Refresh

Views are also redrawn any time their screen or view rectangles are changed. If you are manually setting any screen or view rectangle properties of your View object (such as ScreenTop, ScreenLeft, ViewTop, ViewWidth, etc.), you can suspend this drawing behavior by setting the View's Update property to False. After all the rectangle properties are changed, you can restore the default drawing mode by setting the Update property to True, and making an explicit redraw:

vw.Update = False
'Change some view rectangle properties here
vw.Update = True
vw.Refresh


Changing a View's Size: Zooming and Scrolling

The ZoomToExtents method is a convenient way to correctly set the view rectangle properties (ViewWidth, ViewHeight, ViewTop, ViewLeft) to display the entire contents of the drawing. Of course for complete control of the drawing, you can set these values yourself.

The Camera VBA sample gives some examples of how to change these properties to affect zooming and scrolling.


Changing the View Orientation

Every View object has an associated Camera object attached to it. You can control the camera's location and the location in world space that the camera is looking at through the Camera object's Location and LookAt properties. These must be coordinated with the View object's view rectangle coordinates.

The Camera VBA sample gives some examples of how the Camera properties can be changed these properties to affect the view orientation.


Using the Camera Object

The TurboCAD Camera object allows you to control the direction of viewing. You can control where the camera is located, where it is pointed, and if it is rotated around its viewing axis.


Fixing the Camera Location and Orientation

The TurboCAD Camera object is constructed to behave the same way that cameras are used in real life. The camera is mounted on a platform, analogous to the stable tripod that is used in physical cameras. The camera and platform share a common location specified in 3D world coordinates, accessible in the SDK as a Vertex object property named Location.

The camera lens points at a target location. The target is exposed as a Vertex object property named LookAt, and is also specified in 3D world coordinates.

TurboCAD defines four axes that are used to describe the possible orientation and motions of a camera. Each axis is exposed in the SDK as a Vertex object property. One axis (Up) is used to define the camera platform plane. Another axis (Right) is shared by the platform and the camera, and determines the rotation axis for up-down tilt operations on the camera. Two other perpendicular axes (Top and Direction) are attached to the camera only. Top specifies the direction vector coming out of the top of the camera, and Direction specifies the vector pointing from the camera and platform location towards the target. These four axes are always specified as vectors in the 3D world coordinate system. When you set any of these axes, at least one of the X, Y, or Z components must be non-zero. When you query for the axes, the Vertex object will return a normalized vector (the vector length will always be 1).

Since there are perpendicularity constraints and other interdependencies among the orientation properties, you will cause properties to be recalculated whenever you change them. This figure illustrates the points and vectors that describe the camera location and orientation:

insert figure here

The Location and LookAt properties are handled independently from one another. If you want to move the camera in a parallel manner, you must change Location and LookAt by the same relative X, Y, and Z values. The LookAt point and the Location points must never be set to the same values, or the SDK will force the camera Location point to be set a small distance back from the current LookAt point. Changing the Location or LookAt points may cause the Direction, Top and Right properties to change. The platform Up axis will remain unaffected.

insert sample code for changing Location and lookat

Changing the Up axis changes the orientation of the entire platform and camera system, causing a relative rotation of all other axes. The Right and Top properties will be recalculated based on the current Direction and the new Up properties. You will probably want to set at least one of these other properties after you have changed the Up axis in order to get the camera properly reoriented.

insert sample code for changing up and other values

Changing the Direction axis may cause the LookAt, Right and Top properties to be recalculated. The Up axis will remain unchanged.

insert sample code for changing direction

Changing the Right axis may cause the LookAt, Direction, and Top properties to be recalculated, since changing the Right axis is implemented as a Pan operation around the fixed Up axis (see below). In addition, the perpendicular relationship between the Up and Right axes means that the Right axis will be recalculated also.

insert sample code for changing right

The Top axis is readonly. You can use it to calculate new values for any of the other properties.


Changing the Camera Projection

Two other properties are needed to fully specify the camera's viewing characteristics. The Perspective property (a Boolean True or False) determines whether the camera is used in a perspective or orthographic projection. The orthographic projection is the equivalent of an optical camera with an infinite focal length (hyper-telephoto)-there are no vanishing points or foreshortening in the picture taken by this camera.

insert sample code for switching between ortho and perspective

TurboCAD's viewing model restricts you to an orthographic camera projection when you are using the native vector rendering system, but allows you to use the perspective camera projection (by setting the Perspective property to True) when you are using one of the advanced 3D rendering systems (OpenGL, Hidden Line, and Lightworks rendering). In this case, you can control the focal length of the camera by using the PerspectiveAngle property, which you specify as an angle in degrees between zero (infinite focal length telephoto) and 180 (fish-eye wideangle).

insert sample code for perspective

victor will modify SDK implementation (changes to Up and addition of Top)


Moving the Camera

Once the camera projection has been determined, you can use camera movement properties in the SDK to make the camera move. These settings for these properties attempt to model the movements used in physical camera setups.

Tilt represents the amount of rotation (applied to the Right camera/platform axis) that the lens of the camera swivels up or down at its current location. Since TurboCAD operates in a right-handed coordinate system, a positive Tilt value means the camera is pointing above the platform plane, a zero Tilt value means the camera is pointing along the platform plane, and a negative Tilt value means the camera is pointing below the platform plane. Tilt is measured in degrees, and should be restricted to the range -90 to +90.

Setting the Tilt property will cause the LookAt, Direction, and Top properties to change as a result of the swiveling of the camera at its current location. The Postion, Up and Right properties are left unchanged. The Tilt property value will be recalculated when you make explicit changes to the LookAt, Direction or Top properties.

insert sample code for tilting

Pan is method, not a property, that represents the amount of rotation around the platform Up axis (panning can be thought of as a left-right swiveling of the camera). This rotation is always made relative to the current camera orientation. In our right handed coordinate system, a positive Pan value represents a swivel of the lens to the left, a zero value represents pointing straight ahead, and a negative Pan value represents a swivel of the lens to the right. The Pan angle is also measured in degrees, normalized to the range -180 to 180.

Calling the Pan method with a non-zero value will force the the LookAt, Direction, Right and Top properties to be recalculated as a result of the swiveling of the camera at its current location. The Location and Up properties are left unchanged.

insert sample code for panning

The Roll property represents the amount that you spin the camera around its viewing axis (specified by the Direction property). In the right-handed coordinate system, a positive Roll angle spins the top of the camera to the right. A zero Roll angle means that the Up vector of the platform will be projected as a vertical axis on the projected film plane (this is the normal state of affairs for most photography). As an example, for a typical plan view the normal Up vector will be specified as the +Y axis (0, 1, 0). The platform (and the resulting projected image) can be inverted by setting the Up vector to the -Y axis (0, -1, 0). Setting Roll equal to zero in the will result in a standard plan view in the first case, and an inverted plan view in the second. The Roll angle is also measured in degrees, normalized to the range -180 to +180.

insert sample code for rolling

tangent following method would be cool: track a graphic; ease in/ease out…

Setting the Roll property causes the Top and Right properties to change. The Location, LookAt, Up and Direction properties are left unchanged. Conversely, changing the Up property may cause the Roll property to change, as the platform is moved while the camera's viewing axis stays the same.

Finally, the camera can be tracked by setting appropriate values for Location and LookAt.

insert sample code for tracking


Using the Named View Object

The camera position and zoom factor that represent a view can be stored in the Drawing object's NamedViews collection. A NamedView is an object that you can use to remember these settings and return to them later. You can add any number of NamedView objects and change the current active view to them using this collection.

You access a NamedView by using the standard collection methods. For example, this code changes the active view to the settings stored in a NamedView with the name "View_0":

Dim nvw As NamedView
Set nvw = ActiveDrawing.NamedViews("View_0")
ActiveDrawing.ActiveView.ZoomToNamedView(nvw)


Saving the Current View Using the NamedViews Collection

what about camera settings in named views?

Another way to control the location and orientation of views is via the Drawing object's NamedViews collection. You can save the current view rectangle and camera settings in a NamedView object, and add it to the drawing for future use:

With ActiveDrawing.ActiveView
   Set nvw = ActiveDrawing.NamedViews.Add("SaveMe", _
      .ViewLeft, .ViewTop, .ViewWidth, .ViewHeight, .Camera)
End With


Restoring the View from a NamedView Object

Once you have created a named view either with the TurboCAD UI, or with the SDK you can set any views' zoom level to it by using the View object's ZoomToNamedView method:

ActiveDrawing.ActiveView.ZoomToNamedView("SaveMe")

You can also query the named view for the size (in world coordinates) that the view represents, by using the NamedView object's BoundingBox property:

Dim bbox As BoundingBox
Set bbox = ActiveDrawing.NamedViews("SaveMe").BoundingBox
Debug.Print "Min x: " & bbox.Min.X
Debug.Print "Min y: " & bbox.Min.Y
Debug.Print "Max x: " & bbox.Max.X
Debug.Print "Max y: " & bbox.Max.Y


Using Named Views in Viewports

The viewport graphic is a rectangular window onto model space that you put on a paper space view, that lets you project the model space graphics in a view onto the paper space. In order to create a paper space viewport graphic, you need to have previously created a named view that the viewport will use to determine the zoom level. After creating the viewport graphic, you set the NamedView property of the graphic to the name of the appropriate view:

'Drawing must be in paper space mode
'Viewport graphic goes on paper space
'Add viewport graphic and set it up
Dim vpg As Graphic
Set vpg = ActiveDrawing.Graphics.Add(imsiViewport)
With vpg
   'Set the NamedView property
   .Properties("NamedView") = "SaveMe"
End With

In addition, you must take care to set up the viewport's location and scale correctly. The Viewport VBA sample shows how to create a viewport with the proper factors. For more on viewport graphics, see the "Basic and Regen Graphics in Detail" section.


Changing a View's SpaceMode

Each View object has an active SpaceMode, that determines whether it is drawing ModelSpace or PaperSpace graphics, and which coordinate system it is using. In PaperSpace mode, the View's Camera settings have no effect, but the location and zoom level can be modified.

When you create a new view, the SpaceMode property tracks the current SpaceMode of the view's parent drawing. This behavior is lost as soon as you set view's SpaceMode property. From that point on, you are responsible for maintaining the SpaceMode property explicitly. Getting the current view SpaceMode does not affect whether the tracking is done or whether the view's SpaceMode is controlled by the programmer.


Creating Bitmaps and Metafiles with the View Object

Sometimes instead of working with a TurboCAD drawing directly in the window you might want to output it to a bitmap or Windows metafile created in memory. For instance, this helps avoid flickering of flashing of a drawing in the window when a drawing is repainted. Besides, working with a drawing in memory is faster then in a window.

View object exposes four methods to create a bitmap or metafile in memory:

OpenBitmapDC

OpenMetafileDC

CloseBitmapDC

CloseMetafileDC

When you use the OpenBitmapDC or OpenMetafileDC methods, the View will be disconnected from the window or device context it was previously associated with. The view will stop painting into that window or DC. Instead it will paint into the bitmap or metafile in memory, preserving all settings the View object had at the moment when the OpenBitmapDC or OpenMetafileDC method was called. The original window or device context and other settings will be restored after the CloseBitmapDC or CloseMetafileDC methods return.

NOTE If the View object's MappingMode setting is set to a value other then pixels (MM_TEXT), you should convert it to pixels prior to executing the OpenBitmapDC or OpenMetafileDC method. It is desirable to adjust the View's screen properties (ScreenLeft, ScreenTop, ScreenWidth, ScreenHeight) to reasonable values in pixels before calling the OpenBitmapDC or OpenMetafileDC method.

The OpenBitmapDC and OpenMetafileDC methods do not draw into a memory bitmap or metafile immediately. Actual drawing occurs only when one of the methods causing view drawing is executed (Refresh, ZoomToExtent, etc.) or when the View's Update property is set to True.

After the execution of the OpenBitmapDC or OpenMetafileDC method you can change the View rectangle's parameters (ViewLeft, ViewTop, ViewWidth, ViewHeight), so that you can re-adjust the View to output another part of a drawing into a bitmap. It is recommended to set the View's Update property to False before changing the View's rectangle, otherwise each new property setting will cause painting over the same bitmap.

It is not recommended although possible to modify View's screen properties (ScreenLeft, ScreenTop, ScreenWidth, ScreenHeight) after the OpenBitmapDC or OpenMetafileDC methods have been executed. It will not change the created bitmap, yet potentially might cause unpredictable and undesirable results.

The usual way you will create an image is to make exactly one call that will cause a redraw between the execution of the OpenBitmapDC or OpenMetafileDC method and its corresponding CloseBitmapDC or CloseMetafileDC call. After the bitmap or metafile has been opened in memory each new redraw paints over the current bitmap or metafile, so if you want to make multiple redraws, you may need to use Windows API functions to manipulate the image bits.

simple example

The CloseBitmapDC and CloseMetafileDC methods release the internal device context created by the corresponding OpenBitmapDC or OpenMetafileDC method and then return an image handle to the caller. CloseBitmapDC returns a device-independent bitmap in an array of Bytes. CloseMetafileDC returns a windows enhanced metafile stored in an array of Bytes.

note change to interface and implementation for these

After calling CloseBitmapDC or CloseMetafileDC, you can use the resulting handle in a Windows Graphics Device Interface ("GDI") function such as GetDIBits or PlayMetaFile. When you don't need the memory bitmap or metafile any more, don't forget to remove it from memory. The bitmap handle should be destroyed using the GlobalFree Windows API function, and the metafile using DeleteMetaFile.

You can work with bitmaps and metafiles in VBA using Windows API functions, but there is no easy facility provided for using them directly. Instead VBA objects such as the Image control and UserForm always use a StdPicture object to display bitmap and metafile-based images. Using the StdPicture object frees you from dealing with the complexities of Windows GDI objects.

The TurboCAD SDK includes a helper DLL named ViewPict that converts the bitmaps and metafiles generated by the TurboCAD SDK into StdPicture objects. C++ source code and the DLL that you can use with VBA are included in the SDK installation. Because the functions in ViewPict create a StdPicture object that owns the original bitmap or metafile image, you don't have to explicitly destroy the bitmap or metafile that the TurboCAD View object created when you use these functions.


Using Views To Transform Coordinates

The View object contains utility functions that allow you to convert from view coordinates to world coordinates or from view coordinates to screen coordinates and vice versa:

ScreenToView

ViewToScreen

WorldToView

ViewToWorld

some example?


Picking in Views

View objects can be programmed to let a user interactively select graphics shown in a view. You can use the GetMouseClick view method to wait for a user to click in a view. When this function returns, the X and Y parameters will contain the location of the click in view coordinates:

Dim xClick, yClick As Double
ActiveDrawing.ActiveView.GetMouseClick xClick, yClick

You can use these view coordinates to find out where the user clicked on the screen, or translate them to world coordinates by using the view's coordinate conversion utility functions. You can also ask the view to return a collection of graphics that intersect the click coordinates.

The PickPoint view method takes the view coordinates (as returned by GetMouseClick) and returns a PickResult object (a standard VBA collection) containing all the graphics under the point. You can also submit two points that define the opposite corners of a rectangle in view coordinates to the PickRect method, and it will return a PickResult of all the graphics contained within the view rectangle.

Dim pres As PickResult
Set pres = ActiveDrawing.ActiveView.PickPoint(xClick, yClick)

There is also a drawing method called PickInteractive which waits until the user clicks in any view of the drawing, and returns the PickResult with the results of the click:

Dim pres As PickResult
Set pres = ActiveDrawing.PickInteractive(imsiPickPoint)


Using the PickResult Collection and PickEntry Objects

Each item in the PickResult collection is a PickEntry object that gives information about the graphic picked, what part of the graphic was hit, and how far from the point (or rectangle) the graphic is. You can enumerate the collection and collect or process the picked graphics. Here's an example that selects only the circle objects that have been placed in the PickResult by the previous pick operation:

Dim pent As PickEntry
For Each pent In pres   With pent.Graphic      If .Type = "CIRCLE" Then         .Select      Else         .Unselect     End If  End WithNext


Working With Model Space and Paper Space Layouts

Usually you want to create the graphical contents of your drawing in model space, a 3D "world" coordinate system that can contain 2D and 3D objects. The coordinates you use to create graphics are measured in real world units. When you want to print your drawing, you normally work in one or more Layouts. The contents of each layout are contained in a separate paper space, for which there is only a "plan view" looking down on the virtual paper. Each paper space can have its own independent unit system and scale factor. The paper space can contain viewport graphics that represent different views (camera and scaling) of the contents of the single model space world, as well as "decorative" or per-layout graphics such as dimensions, text, diagrams and tables.

You always work with one active space in a drawing at a time, and the SDK provides mechanisms for switching from one active space to another.


Detecting the Current Space

The Drawing object's TileMode property allows to get or set a drawing's current space, i.e. Paper Space or Model Space. The default value for TileMode is 1 (Model Space). TileMode is an Integer property that can take on the values in the ImsiSpaceMode enumeration:

imsiPaperSpace (0): Paper Space

imsiModelSpace (1): Model Space

Here's an example of how to test the current mode:

'Get the current drawing space mode
Select Case ActiveDrawing.Properties("TileMode")
   Case imsiPaperSpace:
      Debug.Print "Current space mode is Paper Space"
   Case Else:
      Debug.Print "Current space mode is Model Space"
End Select


Changing Between Model Space and Paper Space

To change the the drawing's current space (Paper Space or Model Space), you set the Drawing object's TileMode property to an Integer specifying the desired mode. You use the value imsiModelSpace (1) to set Model Space, and imsiPaperSpace (0) to set Paper Space:

'Set drawing mode to Paper Space
ActiveDrawing.Properties("TileMode") = imsiPaperSpace


Adding a New Paper Layout

The Drawing object's PaperSpaces collection manages the layouts for a drawing. You can create a new layout by using the collection's Add method:

Dim ps As PaperSpace
Set ps = ActiveDrawing.PaperSpaces.Add("NewLayout")


Removing a Paper Layout

You can also remove a layout:

ps.Delete
Set ps = Nothing

Can you remove the "default" paper layout? How can you tell what this one is?


Changing the Active Paper Layout

Once you have set the drawing space mode to paper space, one of the paper layouts will be active. To determine which one, use the ActivePaperSpace property of the Drawing object:

'Get current active space
Dim ps As PaperSpace
Set ps = Drawing.ActivePaperSpace
Debug.Print "Active paper space is " & ps.Name

If you have a paper space object, you can also test whether it is active or not:

'See if it really is active
If ps.Active Then
  Debug.Print "Paper space " & ps.Name & " is active"
Else
  Debug.Print "Paper space " & ps.Name & " is inactive"
End If

To make another paper space active, use the Activate method:

ps.Activate


Setting Paper Space Parameters

Once a paper space is active, you can set up scale and unit information by using extended properties in the Drawing object. Changing these properties only affects the current active paper space. Other paper spaces in inactive layouts will not be changed.

PaperLinearUnits

Need to alias $PLUNITS to PaperLinearUnits

Analogy to model space property

The Drawing object's PaperLinearUnits property determines a family of unit and scale systems that you can use when working with Paper Space. PaperLinearUnits is an Integer property that can take these values:

1: English System

2: Metric System

If you're using the SDK to set up your paper space, you must take care that other parameters you set are compatible with the PaperLinearUnits property currently being used. These compatibility issues will be mentioned as the other properties are described.

'Set paper space units family to English
ActiveDrawing.Properties("PaperLinearUnits") = 1 'English

PaperScaleSystem

Analogy to model space property

The Drawing object's PaperScaleSystem property determines the range of paper to world scales available to the user. TurboCAD lets you set the drawing scale using one of three standard systems: Architectural, Engineering, and Absolute. If the drawing's measurement family (as determined by the PaperLinearUnits property) has been set to Metric, then Absolute will be the only choice available. The following table shows some sample drawing scales expressed in each of these systems:

Architectural:3/16" = 1'-0"

Engineering: 1"= 200'

Absolute: 1:500

You can set PaperScaleSystem through TurboCAD menu: Options à Space Units.

The PaperScaleSystem property is a String with the name of the current scaling system for Paper Space, i.e. ratio of measurements on the page (Paper units) to measurements in the object being modeled (World units). The default value for PaperScaleSystem is "Architectural", with a PaperScale of 1" = 1", one inch to one inch.

To change the PaperScaleSystem property setting, assign it a String containing the name of the scaling system. Valid settings are: "Absolute", "Engineering", "Architectural":

'Set scaling system to architectural
ActiveDrawing.Properties("PaperScaleSystem") = "Architectural"

Note that it is also possible to assign any string value to the PaperScaleSystem property, yet . . .

Is $SCALESYS the same (an alias for) PaperScaleSystem?

PaperScale

Analogy to model space property

The Drawing object's PaperScale property allows you to get and set the scale that converts world units to paper units. You specify this scale as a String. Depending on the scale system selected, the string can be of different forms, i.e "1:2", "1 in=200 ft", etc.) The default PaperScale property setting is "1:1".

To change the PaperScale property setting assign it a string containing the specified scale, e.g.:

'Set scaling to half of the actual size
ActiveDrawing.Properties("PaperScale") = "1:2"

PaperLinearUnitName

Analogy to model space property

The Drawing object's PaperLinearUnitName property allows you to get or set the name of currently used measurement unit for graphics in Paper Space ("in", "m", "mm", etc.):

'Set paper space measurement unit name to inches
ActiveDrawing.Properties("PaperLinearUnitName") = "in"

The PaperLinearUnitName setting must correspond to the PaperLinearUnits setting, i.e. if you set PaperLinearUnits to 1 (English) you should use English measurement system. Theoretically it is possible to specify measurement unit name conflicting with the measurement unit system, yet it might cause unpredictable results.

PaperLinearUnitName2

Analogy to model space property

The Drawing object's PaperLinearUnitName2 controls the name of currently used measurement units for text in Paper Space. This is a String propertywhich gives the unit name ("in", "m", "mm", "pt", etc.). The default setting for PaperLinearUnitName2 is "pt" (points). To change the PaperLinearUnitName2 setting assign a String variable containing the name of the specified measurement units, e.g. "in" (inches):

'Set text measurement unit name to inches
ActiveDrawing.Properties("PaperLinearUnitName2") = "in"

PaperLinearUnitName3

Analogy to model space property

Similar to the other unit names in Paper Space, the Drawing object's PaperLinearUnitName3 lets you get or set the name of the currently used measurement units for line width in Paper Space. This is also a String property that gives a unit name ("in", "m", "mm", "pt", etc.). The default setting for this property is "pt" (points). To change the PaperLinearUnitName3 setting assign a string variable containing the name of the specified measurement units, e.g. "in" (inches):

'Set line width measurement unit name to inches
ActiveDrawing.Properties("PaperLinearUnitName3") = "in"


Using Graphics in Model Space and Paper Space

Every graphic is contained only one space: either the model space, or one of the drawing's layout paper space. Any operations on individual graphics and their owning collections (adding, selecting, etc.) always apply to the currently active space.

How can you tell if a graphic is in model space or in which paper space?


Using Views in Model Space and Paper Space

Views are associated with a particular space: either the single model space, or one of the layout paper spaces. Views behave differently in paper space than in model space. The View's camera is inactive in paper space; making changes to the camera will have no effect. The only control you have over a paper space view is modifying the view's screen and view coordinates.

How can you tell if a view is in model space or in which paper space?


Controlling Page Setup Using the Drawing Object

By setting the following extended Drawing properties, you can change the page setup for the active PaperSpace. Many of these properties are exposed on the Page Setup dialog in the TurboCAD user interface.

Drawing Page Setup Extended Properties
Property | Description
PaperWidth | Width of paper in printer, measured in units of 0.1mm, i.e. 2794 is 279.4 mm or 11 inches.
PaperHeight | Height of paper in printer, measured in units of 0.1mm, i.e. 2159 is 215.9 mm or 8.5 inches.
PaperScale | Scale for paper space as string, i.e. "6" = 1'-0" (Half Size)".
$PLUFACTORS | Array: X, Y, and Z scale factors for the active paper space. So if PaperScale is "half size" as above, this is (0.5, 0.5, 0.5).
PaperLinearUnits | String for paper space units, i.e. "in" for inches. This is not what the documentation above indicates…
PaperLimitsMin | Array: X, Y, and Z coordinates for bottom right (origin) of sheet, measured in paper space units. For example (-5, -4, 0) corresponds to Origin X: -5" and Origin Y: -4" on the Page Setup dialog's Layout tab, if the current paper space unit is inches.
PaperLimitsMax | Array: X, Y, and Z coordinates for top right of sheet, measured in paper space units. By subtracting PaperLimitsMin from this you can get the sheet size. For example, if PaperLimitsMax is (17, 13, 0), and PaperLimitsMin is (-5, -4, 0), then the sheet size is (22, 17, 0). This difference corresponds to World Width: 22" and World Height: 17" on the Page Setup dialog's Layout tab.
$PVPXMIN | Paper space viewport extents minimum X value, measured in paper space units.
$PVPXMAX | Paper space viewport extents maximum X value, measured in paper space units.
$PVPYMIN | Paper space viewport extents minimum Y value, measured in paper space units.
$PVPYMAX | Paper space viewport extents maximum Y value, measured in paper space units.

$PLUORIGIN (<NO ALIAS>) -- Not listed if I enumerate Drawing Properties in tile mode 0.
$PEXTMIN (PaperExtentsMin) -- Always appears to be (0, 0, 0).
$PEXTMIN (PaperExtentsMin) -- Always appears to be (0, 0, 0).
$PGMARGL (MarginLeft) -- Always appears to be 0. Should correspond to "Margins Left:" on Page Setup dialog's Layout tab?
$PGMARGT (MarginTop) -- Always appears to be 0. Should correspond to "Margins Top:" on Page Setup dialog's Layout tab?
$PGMARGR (MarginRight) -- Always appears to be 0. Should correspond to "Margins Right:" on Page Setup dialog's Layout tab?
$PGMARGB (MarginBottom) -- Always appears to be 0. Should correspond to "Margins Bottom:" on Page Setup dialog's Layout tab?
$LAYOUTCOLUMNS (PrintColumns) -- Always appears to be 1. Should correspond to "Columns:" on Page Setup dialog's Layout tab?
$LAYOUTROWS (PrintRows) - Always appears to be 1. Should correspond to "Rows:" on Page Setup dialog's Layout tab?
$VPXMIN (ViewMinX) -- Not listed if I enumerate Drawing Properties in tile mode 0.
$VPXMAX (ViewMaxX) -- Not listed if I enumerate Drawing Properties in tile mode 0.
$VPYMIN (ViewMinY) -- Not listed if I enumerate Drawing Properties in tile mode 0.
$VPYMAX (ViewMaxY) -- Not listed if I enumerate Drawing Properties in tile mode 0.
$LUNITS (LinearUnits) -- String for world units, i.e. "in" for inches.
$LUINMM (LinearUnitsPerMm--bad! this should be LinearUnitsInMm) -- Double representing world units in mm, i.e. 25.4 for inches.
$LUFACTORS (LinearUnitScales) -- Always appears to be (1, 1, 1). Is this the ModelSpace equivalent to $PLUFACTORS?
$LUORIGIN (LinearUnitOrigin) -- Always appears to be (0, 0, 0). Is this the ModelSpace equivalent to $PLUORIGIN?
$EXTMIN (ExtentsMin) -- Always appears to be (0, 0, 0). Is this the ModelSpace equivalent to $PEXTMIN?
$EXTMAX (ExtentsMax) -- Always appears to be (0, 0, 0). Is this the ModelSpace equivalent to $PEXTMAX?
$LIMMIN (LimitsMin) -- Always appears to be (0, 0, 0). Is this the ModelSpace equivalent to $PLIMMIN?
$LIMMAX (LimitsMax) -- Always appears to be (0, 0, 0). Is this the ModelSpace equivalent to $PLIMMAX?

Need sample code


Controlling 3D Rendering

TurboCAD has extensive support for high-quality rendering of 3D objects. The Render and RenderView objects in the object model hierarchy allow you to set up a rendering system, start a rendering job, and save the result as a bitmap.


Using the Renders Collection

You can find out the available rendering capabilities and set up preferences for 3D rendering by using the Render objects contained in the Application object's Renders collection. You can enumerate all the possible rendering modes by trying out the following example:

    Dim i, j, rcount As Long
    Dim rnd As Render
    Dim rmodes As Variant
    With Application.Renders
        rcount = .count
        For i = 0 To rcount - 1
            Set rnd = .Item(i)
            Debug.Print "Render: " & rnd.Name
            rmodes = rnd.modes
            If VarType(rmodes) <> vbEmpty Then
                For j = 0 To UBound(rmodes)
                    Debug.Print " Mode: " & rmodes(j)
                Next
            Else
                Debug.Print " No modes"
            End If
            rmodes = rnd.RadExtendedModes
            If VarType(rmodes) <> vbEmpty Then
                For j = 0 To UBound(rmodes)
                    Debug.Print " Radiosity mode: " & rmodes(j)
                Next
            Else
                Debug.Print " No radiosity modes"
            End If
        Next
    End With


Using the Render Object

Each Render object represents a particular 3D rendering system. TurboCAD ships with the industry standard OpenGL rendering system, a native hidden line renderer, and a high-quality raytracing and radiosity system licensed from Lightwork Design, Ltd. The properties of the Render object allow you to query the capabilities of the particular rendering system, and to set up the defaults for new rendering jobs.

Render Properties
Property | Description
Name | (Read only) String: The name of the process, such as "OpenGL".
RenderModesCount | (Read only) The number of primary render modes that this process supports.
Modes | (Read only) Array of ImsiRenderMode: The collection of IDs for the render modes supported by this process.
DefaultMode | ImsiRenderMode: The default render mode ID for new renderings.
RadExtendedRenderModesCount | (Read only) The number of radiosity render modes that this process supports.
RadExtendedRenderModes | (Read only) Array of ImsiRenderMode: The collection of IDs for the radiosity render modes supported by this process.
RadExtendedMode | ImsiRenderMode: The default secondary rendering mode if primary mode is set to Radiosity.
RadQuality, RadIterationsCount, RadMinArea, RadMaxArea | Quality settings for radiosity rendering.
Render Methods
Method | Description
RunPicture | Perform a rendering process. Does not return until the process is finished. Returns a StdPicture containing the image of the rendering.

Once you have set the rendering mode and quality you can get a bitmap rendering from any view by calling the Render object's only method, Run:

    Dim vw As View
    Dim rnd As Render
    Dim opic As IPicture

    'Set up the camera
    Set vw = ActiveDrawing.ActiveView
    vw.Camera.Perspective = True

    'Set up the rendering type
    Set rnd = Application.Renders("OpenGL")
    rnd.DefaultMode = imsiRenderModeGouraud

    'Run the rendering process
    Set opic = rnd.RunPicture(vw)
    If Not opic Is Nothing Then
        SavePicture opic, "D:\Test.bmp"
    End If

Currently, Run is returning Nothing - need to fix

If you are planning to run a rendering using a time-consuming process, such as radiosity, you can start, monitor and cancel the progress by using the RenderView object.


Using the RenderView Object

For finer control over the rendering process, you can use the RenderView object. Every View object has an associated RenderView object that gives you control over the 3D rendering process. To control the 3D rendering characteristics, you set the properties of the RenderView object.

RenderView Properties
Property | Description
RenderID | Integer: A user-definable ID. If the RenderView has previously been initialized, setting the RenderID property starts another rendering job.
RenderMode | ImsiRenderMode: Primary rendering mode.
RadExtendedMode | ImsiRenderMode: Secondary rendering mode if primary mode is set to Radiosity.
RadQuality, RadIterationsCount, RadMinArea, RadMaxArea | Quality settings for radiosity rendering.
Picture | (Read only) Retrieves a StdPicture object containing the bitmap of the current rendering.
IsRenderRunned | (Read only) Boolean: True if a rendering has begun and has not yet terminated

When the RenderView is correctly set up, you can start or stop a rendering pass by using RenderView object's methods.

RenderView Methods
Method | Description
BeginRender | Starts a new, or restarts the existing rendering job for the RenderView.
DoRender | Starts another rendering job for the RenderView. Returns an error if the RenderView has not been initialized by a previous call to BeginRender, or is currently in the middle of a rendering process.
EndRender | Terminates the current rendering process.

Starting a 3D rendering job by using the Render object's Run method, or by using the RenderView's BeginRender or DoRender methods, causes the RenderView object to take control over its owning view's processes. You can check whether a View's rendering is currently being taken over by the 3D rendering engine by examining the View's ExternalView Boolean property.


Setting Parameters for 3D Rendering


Starting a Rendering Job


Capturing a Rendering Image


Canceling a Rendering Job

Need examples


Finding out About the Application and Drawing Environments

A few miscellaneous collections provided by the SDK let you find out about the runtime extensions to TurboCAD.

Note that the code below doesn't work as of 3/26/01: For Each (_NewEnum/Next) runs infinitely, and omits one entry


Using the RegenMethods Collection

A RegenMethod is a process packaged in a DLL located in TurboCAD's Regens directory that is responsible for maintaining the properties of a graphic object subtype. You can write RegenMethod DLLs using the SDK with an external development system (see the Advanced Projects section for more information on writing your own RegenMethod DLL).

The Application object's RegenMethods collection returns all currently registered external objects, both built-in (shipped with TurboCAD program) and user-designed objects.

The following example prints all RegenMethods to the Immediate Window:

Dim rm As RegenMethod
For Each rm In Application.RegenMethods
    Debug.Print rm.Name
Next


Using the Filters Collection

A Filter (or file converter) is a process packaged in a DLL located in TurboCAD's Filters directory that is responsible for opening and saving of files of a certain type (format). You can write Filter DLLs using the SDK with an external development system (see the Advanced Projects section for more information on writing your own Filter DLL).

By enumerating the Application's Filters collection you can get a list of the file types supported by TurboCAD in your application environment.

The following example prints file extensions recognized by TurboCAD and their descriptions to the Immediate Window.

Dim flt As Filter
For Each flt In Application.Filters
      Debug.Print flt.Extension; ", " flt.Description
Next

Can you open a file with this collection? Not implemented…


Using the Tools Collection

A Tool is a process contained in a DLL in TurboCAD's Tools directory that can be integrated into the TurboCAD user interface. You can write Tool DLLs using the SDK with an external development system (see the Advanced Projects section for more information on writing your own Tool DLL). You can find out the names of all the currently registered Tools by enumerating the Application object's Tools collection:

Dim t As Tool
For Each t In Application.Tools
   Debug.Print t.CommandName
Next

You can also run any of these tools from the SDK by using the Tool object's Activate method:

Application.Tools("someName").Activate


Using the Macros Collection

A Macro object in TurboCAD is an object that holds information about a Visual Basic for Applications project associated with a drawing (packaged in a .TCM file). You can list all the VBA projects associated with a drawing by enumerating the Drawing object's Macros collection:

Dim mac As Macro
For Each mac In ActiveDrawing.Macros
   Debug.Print "Macro " & mac.Name & ", contained in " & mac.Path
Next

Can't list modules, userforms, or class modules within a "Macro"

Can't list subs within a module

Can't run subs from SDK


Using Events


Events and Event Handlers

Most code that you write directly controls what TurboCAD does, and you as the programmer specify the time when the code is executed. At times, however you may want to write code that is triggered by an action that a user has performed in TurboCAD. These triggers are called events. Using the SDK, you can establish a connection between TurboCAD's event mechanism and subroutines that you write, called event handlers, that will be called by TurboCAD as the event is triggered (or "fired"). In this way you can trap mouse movements, drawings being opened or closed, and other actions.


TurboCAD Event Interface

The suite of events that TurboCAD fires is defined by an event interface. Each event has an exact signature (sub name, and number, type, and order of parameters) that you must implement as a subroutine that you declare in Visual Basic for Applications class module or user form. Since the event mechanism is constructed as a late-bound interface, you don't have to implement all the events that TurboCAD may fire, just the ones you need to handle, and you can tell TurboCAD explicitly which events you're interested in.

The following table lists the complete event interface. For the detailed syntax of each event, consult the Visual Basic Reference.

TurboCAD Events
Event | Description
BeforeExit | Fired before the Application object quits.
DrawingNew | Fired after a new Drawing object is created.
DrawingOpen | Fired after an existing Drawing object was opened.
DrawingActivate | Fired after a Drawing object was activated.
DrawingDeactivate | Fired when a Drawing object will be deactivated.
DrawingBeforeClose | Fired before a Drawing object is closed.
DrawingBeforeSave | Fired before a Drawing object is saved.
DrawingAfterSave | Fired after a Drawing object was saved.
MouseDown | Fired when a mouse button was pressed.
MouseUp | Fired when a mouse button was released.
MouseMove | Fired when the mouse was moved.
BeforeDoubleClick | Fired before a double click action is taken.
BeforeRightClick | Fired before a right click action is taken.
SelectionChange | Fired after the Selection object has changed.
RunTool | Fired when a Tool object is activated.
PointSnapped | Fired when a point was picked in a View object.
PointPick | Fired when a point pick operation was completed or canceled.
RectanglePick | Fired when a rectangle pick operation was completed or canceled.
PolygonPick | Fired when a polygon pick operation was completed or canceled.
VirtualIntersectionPick | Fired when a virtual intersection pick operation was completed or canceled.
Drop | Fired after something was dropped into a drawing.
ViewBeforeRedraw | Fired before a View object is redrawn.
ViewAfterRedraw | Fired after a View object was redrawn.
WindowResize | Fired when a Window object was resized.
WindowActivate | Fired when a Window object was activated.
WindowDeactivate | Fired before a Window object is deactivated.
CommandBarControlHit | Fired when a CommandBarControl object was hit.
CommandBarControlStatus | Fired to inquire on the status of a CommandBarControl object.
CommandBarControlDone | Fired after the command has finished.


Handling TurboCAD Events in VBA

To set up event handling you need to do three things in your Visual Basic for Applications project:

  • Create a class module (or user form) with subroutine named and defined with signatures from the list of available events.
  • Instantiate an event handler class object from your class module or user form with the New statement.
  • Call the TurboCAD Application object's ConnectEvents method, passing the event handler class object, and a mask value that tells TurboCAD which events you are handling.

The ConnectEvents method returns a connection ID as a Long. The mask parameter is required to listen only to a subset of the full event set.

The following example shows how create a class module to listen to MouseDown event and a module to process this event.

First create the event handler class module. In the Visual Basic Editor, right click on the current project and choose "Insert… Class Module" from the context menu. Change the name of the class module from "ClassModule1" to "clsEvents" in the object browser. Then create a public subroutine named MouseDown:

Public Sub MouseDown(WhichDrawing As Drawing, WhichView As View, _
  WhichWindow As Window, Button As ImsiMouseButton, _
  Shift As Long, X As Long, Y As Long, Cancel As IMSI_BOOL)
     MsgBox "MouseDown Event: X = " & X & ", Y = " & Y
End Sub

Now insert the regular module you'll use to connect the event handler, and create a subroutine you can call as a TurboCAD macro:

'Global variable to store connection number
Public idConnection as Long

'Connection subroutine
Public Sub EstablishMouseDownHandlerConnection()
    'Create the event handler object
    Dim handler As New clsEvents
    'Disconnect any previously connected events
    If idConnection > 0 Then
        Application.DisconnectEvents idConnection
    End If
    'Connect the handler
    'Use imsiEventMouseDown mask (only send us MouseDown events)
    idConnection = Application.ConnectEvents(handler, imsiEventMouseDown)
    'We don't need the reference to our handler anymore
    'But TurboCAD now has a reference to it!
    Set handler = Nothing
End Sub

The class module for handling events must implement at least one valid TurboCAD event. In other words, it must include public subroutines named MouseDown, MouseUp, SelectionChange, etc., with the proper number, type and order of parameters.

In principle you can create any number of event handlers with any combination of events you are listening to, yet at any given time due to perfomance considerations TurboCAD cannot connect more than nine events. It's good practice to disconnect events you no longer need before connecting to new ones.

It is recommended to write one class module to implement all event handling you might need and then listen to specific event using an appropriate event mask in ConnectEvents call. A mask can be any combination of event mask constants.


Disconnecting an Event Handler

Once you have established an event connection, your event handler remains connected even after the subroutine that contains the ConnectEvents call has finished running, and you have released your code's references to the event handler object. To disconnect your event handler, you must call the Application object's DisconnectEvents method and pass it the ID value you obtained in ConnectEvents method:

Application.DisconnectEvents idConnection
'Since idConnection is a global, make sure we reset it
idConnection = 0


Working with Microsoft Office VBA

If you have installed any of the applications in Microsoft Office 97 or 2000, you can take advantage of their VBA type libraries and build macros that combine the data and text handling capabilities of Office with TurboCAD's drawing and rendering power. For example, you can build a macro that reads coordinate data from an Excel spreadsheet to build 2D and 3D objects in TurboCAD. You can also export the contents of a TurboCAD drawing to a Microsoft Excel spreadsheet or Microsoft Access database.


Referencing Office Objects in TurboCAD VBA

You can declare and initialize Office objects just as you TurboCAD objects. Make sure that you have the proper libraries referenced before you begin to use them. Add the references to in the Tools - References… menu item. The libraries that were current at the time that this documentation was written were:

  • Microsoft Office 9.0 Object Library
  • Microsoft Word 9.0 Object Library
  • Microsoft Excel 9.0 Object Library
  • Microsoft PowerPoint 9.0 Object Library
  • Microsoft Access 9.0 Object Library
  • Microsoft Outlook 9.0 Object Library

After adding the references, you follow the same steps that you would use to create a TurboCAD variable. Just prefix the object type names with the Office application library you are using. This example shows how to start up an Excel application and open an Excel workbook:

    Dim xlapp As New Excel.Application

    'Test to see if Excel was initialized
    If xlapp Is Nothing Then
        MsgBox "Could not create Excel application object"
        Exit Sub
    End If

    'Open a workbook
    Dim xlbook As Excel.Workbook
    Set xlbook = xlapp.Workbooks.Open("J:\Samples\New\Excel\Contours.xls")

When you're done using the Office application, make sure to release the references to the application and other objects. If you don't do this, you'll use up memory resources on your computer by leaving copies of Excel running that you're no longer using:

    'Release Excel stuff
    Set xlbook = Nothing
    Set xlapp = Nothing

To learn more about programming Microsoft Office products, read the "Microsoft Visual Basic Help" files, accessible from the Help menu of the VBA Editor when you're running an Office application.

The Excel sample included in the SDK shows how you can read from an Excel spreadsheet to build a 3-dimensional contour map in TurboCAD.


Referencing TurboCAD Objects in Microsoft Office VBA

When you are programming VBA macros in a Microsoft Office application, you can invoke TurboCAD as an external application. The steps are the same. First, you add the "TurboCAD 4.1 Programmable Objects" reference. Then create the TurboCAD application object. You should use the Visual Basic CreateObject function to start a separate instance of TurboCAD running:

    Dim tcapp As IMSIGX.Application
    Dim dwg As IMSIGX.Drawing
    Set tcapp = CreateObject("TurboCAD.Application")
    If tcapp Is Nothing Then
        MsgBox "Could not create TurboCAD application"
        Exit Sub
    End If

    'Create a new drawing
    Set dwg = tcapp.Drawings.Add

When done with using TurboCAD, make sure to quit the application and release any references:

    'Release TurboCAD stuff
    Set dwg = Nothing
    tcapp.Quit
    Set tcapp = Nothing

The Excel2 sample shows the same functionality in building a contour map drawing in TurboCAD.


Working with SQL Databases via Microsoft ActiveX Data Objects

Programming the SDK, you can treat TurboCAD as a database. By using Drawing and Graphic properties, you can store, retrieve and search for data in a drawing. You can also link the graphics in a drawing to external databases using a custom property to store the link information. This section will give a brief overview of how you can use Visual Basic for Applications to set up a connection to an external database and to transfer data between TurboCAD and the database using Microsoft ADO.


Setting up the Data Source

Before you can use ADO, you need to provide a data source specification to your database. In our example, we will use an Access .MDB file, but many other types of sources are compatible with ADO. Microsoft and third-party vendors supply the necessary drivers to tie any source of data that can be modeled as rows and columns to the ADO framework.


Adding a Block Attribute To Provide the Data Link

One way to link to external databases is through Block attributes. You can create an attribute named "Dbid" that can hold the primary key id in the database table. You can then write a user form that links the block insertion to a specific database record, and updates the database.


Creating Advanced Projects with the TurboCAD SDK

By using the TurboCAD SDK, and a compiler or environment that knows how to communicate with objects using Microsoft's COM (Component Object Model) API, you can build a wide variety of custom solutions for CAD users. The TurboCAD "engine", comprised of a collection of DLL's and the TurboCAD executable program itself can be customized and extended by special servers that you can write and install. Alternatively you can build your own front-end or user interface and use the TurboCAD engine to load, save, modify and display CAD data in any way you can imagine. You can write standalone applications that run on the Windows operating system, ActiveX controls that can be hosted on a web page or in a Microsoft Office application, and even special custom server components that can combine CAD data with other information to build N-tier solutions in geographic information systems, 3D catalogs, and other enterprise activities.

This section of the TurboCAD SDK documentation will give you the details necessary to build these extensions and solutions, and the numerous examples that come with the SDK provide insight into some of the ways you can build interesting and exciting CAD projects.

IMPORTANT NOTE You will need to obtain an SDK developer license if you intend to build and distribute any project that links to (statically or dynamically) or includes any TurboCAD source code or object code in any way. A sample agreement form can be found here. If you have questions about the terms and limitations of your SDK license, please contact IMSI.


Using Different Development Environments

TurboCAD SDK projects can be built using any compiler that supports the Win32 API, COM (Component Object Model) API and OLE (Object Linking and Embedding) Automation API (in this documentation, we will refer to OLE Automation as "Automation"). The documentation and samples that come with the SDK illustrate how to build projects using the development environments and tools that Microsoft supplies: Visual Basic (version 6.0), Visual C++ (version 6.0), and VBScript (current version is 5.5). Other languages and tools (supplied by Microsoft and other vendors), as well as earlier versions of these compilers and interpreters, can also be used, but will not be supported by IMSI technical support.

Most of the documentation (including the reference pages) for the SDK is directed at the Visual Basic environment, since it is usually the simplest way to create SDK projects. In the sections that follow, special notes for C++ programmers will be indicated by the image ##CPP##, and notes for VBScript programmers will be shown by the image ##VBS##.

The documentation will provide a brief comparison of the differences in syntax, data types, and compiler support between these three development systems. Other details of the differences involved are best explained by looking at the SDK sample code, which is organized by development tool, and by consulting the extensive documentation that Microsoft provides on its developer website at http://msdn.micorosoft.com.


Using Automation Types: Variants, Strings, Objects and Arrays

One of the most key concepts that you will encounter in programming for Automation is the Variant type. This type is used to hold data values in a wrapper object that can handle transferring data across process boundaries, and converting data from and to a variety of formats. In addition to holding standard scalar values (short integer, long integer, floating point, boolean), Variants can also hold dynamic strings (BSTRs), object references, and even dynamically resized arrays of all these types. The Variant type is exposed by the different development systems in subtle ways.


Automation Types in Visual Basic

Since Automation was first introduced to programmers using Visual Basic, the language has extremely flexible features for dealing with variable types. You can choose to strongly type all your variables, declaring them as specific value types, such as Integer, Double, Object, String, etc., or you can leave them untyped, and let Visual Basic perform the necessary type conversions silently for you. For the latter case, Visual Basic provides the Variant type.

Variants

Variant is a key word in Visual Basic. Typically a variable is declared as a Variant with a Dim statement, such as:

Dim v As Variant

Data is transferred into and out of the Variant by assignment:

v = "String"
v = 1

All variables that are not declared as specific types (and all variables that are used without an explicit declaration) are treated as Variants:

Dim untypedVar 'untypedVar is a Variant
undeclaredVar = 2 'undeclaredVar is a Variant

The use of undeclared variables will generate an error if the Option Explicit statement appears in a Visual Basic module, and is generally a bad idea, because it can create confusion about the scope of variable names.

Objects

Object is also a keyword in Visual Basic. An variable declared as Object is in one of two states: either "nothing" or holding a reference to a COM object. Whether the variable contains a reference can be established by the following test:

Dim obj As Object
If obj Is Nothing Then MsgBox "No reference"

Assignment to a variable of the generic Object type (or any specific object type, such as the TurboCAD Drawing type) must be done using the Set statement:

Set obj = CreateObject("TurboCAD.Application.4")

Object references can also be transferred to Variants, again using the Set statement:

Set v = obj

Strings

String is a native type in Visual Basic, so no special processing is necessary:

Dim s as String
s = "Hello, TurboCAD"

Arrays

Multidimensional arrays can be declared with Visual Basic Dim statements, using parentheses to distinguish arrays from scalar values. The size of the array can be fixed at declaration time, or can be resized at any time by leaving the array dimensions unspecified in the declaration, and then using the Visual Basic ReDim statement.

Dim
FixedArrayOfDoubles(10) As Double
Dim ResizeableArrayOfDoubles() As Double
Dim newSize As Integer
newSize = 10
ReDim ResizableArrayOfDoubles(newSize)

Arrays can be assigned to variables of the type Variant:

Dim VariantArrayOfDoubles As Variant
VariantArrayOfDoubles = FixedArrayOfDoubles

And a Variant holding an array can be created and initialized through the Visual Basic Array function:

VariantArrayOfDoubles = Array(1#, 2#, 3#, 4#)

Array elements are accessed through the () operator:

Dim D as Double
D = VariantArrayOfDoubles(0)


Automation Types in Visual C++

##CPP##

As the number of APIs and frameworks that Visual C++ supports has grown over the years, Automation support in Visual C++ comes in many different flavors. You can choose to work with one or more of these flavors, depending on which libraries and frameworks you are using to build your Visual C++ application or add-in. This section will distinguish between the following levels of support:

Win32. This is the basic C-callable Windows API. The Microsoft IDL compiler allows both the COM implementer and user to create and include header files that contain both C and C++ structures and classes that describe the interfaces that you use in COM programming. Using the basic functionality provided by IDL and the Win32 API, developers can build and use any COM object, but they must be extremely careful to observe the strict reference counting, initialization and termination, memory handling and error handling rules that are documented in the COM specification and Win32 API.

Microsoft C++ language extensions and smart pointers. Starting with Visual C++ 5.0, Microsoft added special attributes, keywords and header files that make working with COM objects much simpler and safer than before. The goal was to permit a Visual Basic style of coding, where programmers can make use of "smart pointer" classes that automatically encapsulate much of the boring work of reference counting, interface querying and other monotonous COM tasks. Microsoft has added compiler and linker functionality that can automatically generate these C++ classes from COM type libraries, by the use of the Microsoft-specifc #import statement, and the inclusion of the comdef.h header file.

MFC (Microsoft Foundation Classes). This is the popular C++ application framework introduced by Microsoft to promote wizard-based creation of applications and controls with standard functionality. MFC provides standard, single-inheritance classes that do not make use of templates, and macros that permit relatively easy ways to implement and use Automation objects. MFC also includes a component wizard that creates glue code when using COM dual interfaces and event interfaces specified in type libraries.

ATL (Active Template Library). This C++ framework makes heavy use of C++ templates and multiple inheritance in an effort to produce leaner executables than MFC. ATL and its sister framework, WTL (Windows Template Library), cover much of the same functionality as MFC without the need for large runtime libraries. For this reason, ATL is considered the preferred method for implementing Automation servers and controls in Visual C++.

Variants

Variants are supported at the base Win32 API level through the VARIANT struct. The Win32 API exposes numerous functions and macros for the initializing, assigning, destroying, copying and type-coercing of VARIANT variables.

The VARIANT struct has two members: vt, which determines the type of data held by the VARIANT, and a union which handles the typecasting of the data. VARIANT structs should always be initialized before use by calling the VariantInit function, and memory and object references stored in VARIANTs can be released by calling the VariantClear function. Both VariantInit and VariantClear leave the state of the VARIANT as "empty" (the value of the vt member is VT_EMPTY). Failure to use these functions in the proper order will give your program protection faults and memory leaks.

Another common use of Variants occurs when you are calling an automation method that has optional parameters, as defined in the Visual Basic and IDL interfaces. These parameters are NOT optional when you are calling from C++. Instead you are required to supply a VARIANT struct instance variable (or pointer to a VARIANT) to the method call, in which the vt member value is VT_ERROR, and the scode union member is set to DISP_E_PARAMNOTFOUND.

VARIANTs can be copied using the VariantCopy or VariantCopyInd functions, and can be converted to different types by using the VariantChangeType function. Numerous functions for performing common math, string and other operations using VARIANTs can be found in the Win32 header file oleauto.h.

The VC++ extension to the VARIANT struct is the class variant_t. This class handles most of the memory and type-conversion issues encountered during normal use of variants. variant_t is defined in the comutil.h header file.

MFC also attempts to make the VARIANT struct easy to use by creating an inherited class that automatically performs these setup and conversion chores, called ColeVariant.

The ATL dialect for dealing with Variants is another utility class (simpler and more COM-oriented than its MFC cousin) called CComVariant.

Objects

COM objects in C++ are strictly defined as pointers to an IUnknown interface, which must be supported by every COM object, and handles reference counting and access to other interfaces that the object might expose. In the TurboCAD SDK, all objects support the IDispatch interface (which derives from IUnknown) in addition to their own IDispatch-derived VTBL interface. This means that they are termed "dual" interfaces, meaning that they support late binding and discovery of methods and properties as well as providing fast access to early-bound types through the VTBL. Usually it is unnecessary to use an IUnknown variable type, unless you want to reuse the variable for other purposes. Instead you can use the well-known VTBL interface for better performance.

In C++ or any language that offers access to the Win32 API, you must follow reference counting rules on all object pointers: whenever you get a new object pointer from the Automation system, or from a TurboCAD SDK call, the object pointer that you are given has been reference counted by the system by an internal AddRef method call on the object. Once you have the object's pointer you have control of that object's lifetime. In order to let go of the object properly, you must call the object's Release method when you are no longer interested in the object. Similarly if you need to make a copy of the object, or store it in another variable, you should call the object's AddRef method. Every AddRef call (either internal by the system, or explicitly in your code) must be carefully balanced by a Release call. After the Release call is made, you can no longer be sure the pointer reference is valid.

The other feature of COM objects that the IUnknown interface provides is the ability to "query an interface", that is to find out if the particular object instance referenced by the IUnknown pointer exposes other, derived interfaces. These interfaces are identified by an IID (interface ID), and the QueryInterface method is used to return a pointer (already AddRef'ed) to the derived interface. Any non-null value returned by this method must be properly Released as well.

Visual C++ language extensions to the IUnknown interface are enabled through the use of the #import statement. #import causes the compiler to generate a pair of interface and implementation files that automatically get inserted into your code. These files (with extension .tlh and .tli, respectively) contain wrapper classes that exhibit "smart pointer" semantics to ensure the proper reference counting and query interface rules are applied when you perform common operations such as construction, assignment and "casting" to derived interfaces. The .tlh and .tli files make use of smart pointer macros contained in the comdef.h header file. After adding the #import statement to your source file, using these smart pointers is as easy as declaring an object instance with a standard naming convention. For example, to use a variable that is intended to hold a reference to the TurboCAD IDrawing interface, you can define the variable to be of class IDrawingPtr. The compiler-generated object smart pointer classes also contain methods for creating objects (using the underlying COM CoCreateInstance functions) as well as type conversion and overloaded operators that provide the programmer with the ability to approximate the syntactic simplicity of Visual Basic. These classes also are integrated with the COM error and C++ exception systems, so that errors are properly propagated to the caller. See the Visual C++ documentation for the full details on using the #import statement and smart pointers.

MFC has no easy way to arbitrarily use derived interfaces, but there are wizards that build IDispatch-based linkage.

ATL uses two templates, CComPtr and CComQIPtr, to provide "smart pointer" semantics. In the TurboCAD example shown above, the ATL equivalent is to declare a variable of type CComPtr<IDrawing>. For IDispatch (late binding) access to objects, ATL has the CComDispatchDriver utility class. These are all defined in the atlbase.h header file. Since ATL is primarily used to implement COM objects, there also is a huge amount of template-based class support in ATL for construction, destruction, containment, collection and other features commonly needed by COM implementers.

VARIANTs can be used to hold objects by setting their vt to VT_DISPATCH, and their pdispVal member to point to the object. Again, the variant functions take care of AddRef and Release calls during VariantCopy and VariantClear operations, so be careful not to Release pointers that have been transferred to VARIANTs (or alternatively, make sure that you AddRef them when you do assign them to VARIANTs).

Strings

Automation strings are handled through a Win32 type named BSTR. This is defined as an unsigned short*, and points to either NULL or a system allocated, counted buffer of 16-bit UNICODE characters. Because BSTRs can be created by and passed to any thread or process, and because they contain length information in the four bytes preceding the BSTR pointer itself, all memory allocation, reallocation and deallocation of BSTRs must be done through Win32 functions defined in the oleauto.h header file: SysAllocString, SysAllocStringLen, SysReAllocString, SysReAllocStringLen and SysFreeString. The length of a BSTR can be retrieved by using the SysStringByteLen or SysStringLen functions, (depending on whether you need the number of bytes or UNICODE chars that the string contains). Since BSTRs are required to be UNICODE, you can either select UNICODE as the default for your C++ program, or use development tools that convert between ANSI (single and double byte characters, or "multibyte" characters) to and from UNICODE (wide characters). The low-level Win32 conversion functions are named MultiByteToWideChar and WideCharToMultiByte, and are defined in winnls.h. These somewhat complicated conversion functions are wrapped by macros and inline functions such as W2A, A2W and A2BSTR that perform temporary stack-based allocation and deallocation, BSTR allocation, and also supply standard parameters. You can find these macros in the ansiapi.h header file.

The VC++ extension to the BSTR type is the class bstr_t. As expected, this class handles most of the memory and type-conversion issues encountered during normal use of strings.

In MFC, the CString class encapsulates BSTR conversions and creation, using ANSI or UNICODE strings as the contained data, depending on the compiler switch.

In ATL, the CComBSTR wrapper class is a thin wrapper around the BSTR type and utility functions. Just to be redundant, ATL has its own set of W2A family macros defined in the atlconv.h header file.

ATL supplies macros that you can use to convert between UNICODE wide characters and ANSI characters.

VARIANT structures can hold strings by setting their vt member to VT_BSTR, and setting the bstrVal member to point to the BSTR. The variant functions will properly copy and release memory for BSTRs, so be careful not to call SysFreeString on a pointer that has be passed to a VARIANT which has subsequently been cleared by VariantClear. Similar ownership rules for strings apply to the variant wrapper classes supplied by the frameworks.

Arrays

Automation arrays are manipulated using the SAFEARRAY struct in the Win32 API and associated functions found in oleauto.h, primarily: SafeArrayCreate, SafeArrayDestroy, SafeArrayRedim, SafeArrayGetElement, SafeArrayPutElement, SafeArrayAccessData, andSafeArrayUnaccessData.

MFC wraps some SAFEARRAY functionality in the COleSafeArray class, defined in afxdisp.h.

There is no support for SAFEARRAY currently exposed by the Visual C++ extensions or ATL.

Arrays can also be assigned to VARIANT variables, through the use of the flag VT_ARRAY which is added to the scalar type specified in the vt member. When the vt member has the VT_ARRAY flag set, the parray union member is expected to point to a valid SAFEARRAY pointer. Arrays passed as VARIANTs to TurboCAD SDK functions are typically set up as follows:

VARIANT variantArrayOfDoubles;
VariantInit(&variantArrayOfDoubles);       // Good practice to always do this
variantArrayOfDoubles.vt = VT_ARRAY|VT_R8; // Type is "array of doubles"

// Set up an empty (length 0) array of doubles
// Describe the (only) dimension of the array
SAFEARRAYBOUND bound;
bound.cElements = 0; // Empty array
bound.lLbound = 0;   // By convention all arrays should be zero-based
variantArrayOfDoubles.parray = SafeArrayCreate(VT_R8, 1, &bound);

if (SUCCEEDED(pObject->SomeFunctionTakingAVariant(&variantArrayOfDoubles)))
{
    // Now try to extract an element
    double d = 0; // where to store result
    long lIndex = 0;
    SafeArrayGetElement(variantArrayOfDoubles.parray, &lIndex, (void**)&d);
}

// Always release VARIANT memory when done
// VariantClear will call SafeArrayDestroy internally
VariantClear(&variantArrayOfDoubles);


Automation Types in VBScript

##VBS##

VBScript is scripting language developed by Microsoft that bears syntax similarities to Visual Basic. VBScript is commonly used for client-side and server-side programming on HTML pages, and is also supported by the Windows Scripting Host, a programming environment that is part of standard Windows installations. VBScript, like most other script languages is "typeless", but supports conversion between a number of built-in "subtypes" such as Integer, String and Object. VBScript also supports the ability to reference COM object types and interfaces at runtime.

Variants

Every variable in VBScript is a Variant. You declare variables using the Dim statement, but unlike the typing system in Visual Basic, you don't specify a type:

Dim myVar
myVar = 2
myVar = "now I'm a string"

Objects

Just as in Visual Basic, you can create objects using the CreateObject function, and create references to them using the Set statement. Since variables in VBScript are untyped, you can find out if a variable holds an object reference using the VarType statement.

Dim myVar
Set myVar = CreateObject("IMSIGX.Application")
MsgBox "myVar is a " & VarType(myVar)

Strings

Strings are treated as in Visual Basic as a built-in subtype.

Arrays

Arrays are declared similarly to Visual Basic, and can be of fixed or dynamic size. The Dim and Redim statements are used to declare and resize array types.


Using the Application, Drawing and View Objects

The contents of this section will discuss some of the details you need to be aware of when using the TurboCAD Application, Drawing and View objects in your applications.


Creating an Application Object in In-Process and Out-Of-Process Servers

The TurboCAD Application object can be created as an in-process (DLL) server, in a custom client application's process with a user interface provided by the client application. In this way you can read files, create drawings, add, modify and delete graphics, and display drawings on your application's user-defined viewports.

The TurboCAD Application object can also be created as a local (EXE) server. In this scenario the objects are provided by the TurboCAD engine, and your client can control and customize the operation of TurboCAD, adding user interface elements, receiving events fired by TurboCAD, and extending the operation of TurboCAD. If TurboCAD has been launched by a user, your client application can also connect to the active running instance of TurboCAD.

In general, in-process servers run faster than local servers. The in-process server is contained in IMSIGX<xx>.DLL (where xx - DLL version number, e.g. 70), together with support from DBAPI<xx>.DLL, TCAPI<xx>.DLL, and a variety of graphic regeneration method and drawing file format filter DLLs. Use the local server option when you require TurboCAD's user interface (menus, toolbars and windows).

The in-process and local servers have distinct ProgIDs and CLSIDs, so make sure you use the correct string when you create a TurboCAD Application object. After locating the server the system starts up the server and requests an object.

Creating an Application Object in Visual Basic

Unless you work with TurboCAD VBA, you may need to explicitly set a reference to the TurboCAD type library to create a TurboCAD Application object in your custom application. The type library is contained in the IMSIGX70.DLL file typically found in the Program subdirectory of your TurboCAD installation. If it has been registered correctly, the type library will will appear in Visual Basic's References dialog as "TurboCAD v4.1 Programmable Objects". If it has not been registered, you will need to browse to the IMSIGX70.DLL file to add the reference.

Then to create an Application object, the statements:

Dim app As IMSIGX.Application
Set app = CreateObject(, "IMSIGX.Application")

will start up the in-process (DLL) server, and the statements:

Dim app As TurboCAD.Application
Set app = CreateObject(, "TurboCAD.Application")

will start up the local (or out-of-process, EXE) server.

You may also use the As New syntax to create the Application object:

Dim app As New TurboCAD.Application

You can also connect to a running instance of TurboCAD (as an out-of-process server by using the GetObject function:

Dim app As TurboCAD.Application
Set app = GetObject("TurboCAD.Application")

GetObject will return a Nothing reference if TurboCAD is not running on the same machine as the calling Visual Basic application.

Creating an Application Object in C++

##CPP##

In C++ or other languages that allow direct calls to the Win32 API, the choice between in-process and local servers is also determined by the dwClsContext argument to the CoCreateInstance or CoCreateInstanceEx functions, as well as the CLSID values passed. CLSID_XApplication refers to the in-process server, and CLSID_Application refers to the out-of-process server. For example,

IApplication* pIApp = NULL;
HRESULT hr = CoCreateInstance(CLSID_XApplication, NULL, CLSCTX_INPROC_SERVER, IID_IApplication, (void**)&pIApp);

will start up the in-process (DLL) server, while

HRESULT hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_LOCAL_SERVER, IID_IApplication, (void**)&pIApp);

will start up the local (EXE) server.

When you use the Visual C++ extension syntax and smart pointers, it is usually easier to specify the appropriate ProgID (a string which is used by the COM system to look up the correct CLSID for the server), assuming that all the type libraries have been correctly registered. In addition, you must specify the correct creation context. "IMSIGX.Application" is the ProgID used for the in-process server (which corresponds to CLSID_XApplication), and "TurboCAD.Application" is the ProgID used for the out-of-process server (which corresponds to CLSID_Application). Consult these examples:

#import "imsigx.tlb"

HRESULT hr;
IMSIGX::IApplicationPtr spIApp;
hr = spIApp.CreateInstance("IMSIGX.Application", NULL, CLSCTX_INPROC_SERVER); // in-process
hr = spIApp.CreateInstance("TurboCAD.Application", NULL, CLSCTX_LOCAL_SERVER); // local server

In ATL, you accomplish the same thing with:

HRESULT hr;
CComPtr<IApplication> spIApp;
hr = spIApp.CoCreateInstance(L"IMSIGX.Application", NULL, CLSCTX_INPROC_SERVER);
hr = spIApp.CoCreateInstance(L"TurboCAD.Application", NULL, CLSCTX_LOCAL_SERVER);

Creating an Application Object in VBScript

##VBS##

To create a VBScript object that gives access to the TurboCAD in-process application object, you use the CreateObject constructor, passing the appropriate ProgID string:

Dim app
Set app = CreateObject("IMSIGX.Application"
WScript.Echo "in_proc"
If app Is Not Nothing Then WScript.Echo " version " & app.Version


Destroying the In-Process or Out-of-Process Application Object

If you have created a TurboCAD Application object as in-process server it will be automatically destroyed when last reference to it is destroyed:

Dim app as New IMSIGX.Application
'Work with Application object
Set app = Nothing 'VB implicitly does this when variable goes out of scope

However, in case of an out-of-processes server releasing reference to the object variable holding the Application object will not close TurboCAD itself. To close the TurboCAD itself you need to use Quit method of the Application object:

Set app = CreateObject("TurboCAD.Application")
'Work with Application object
app.Quit
Set app = Nothing

##CPP##

In C++, you must follow the same rules. If you're programming directly to the Win32 API, you must release your application object reference explicitly. In addition, you must force the out-of-process (EXE) server to quit properly.

In-process server example:

pIApp->Release();
pIApp = NULL;

Out-of-process server example:

hr = pIApp->Quit();
pIApp->Release();
pIApp = NULL;

The smart pointers provided by MFC and ATL automatically do the reference releasing for you when the variables go out of scope, or when you set their value to NULL explicitly. You must still call the Quit method for the out-of-process server, however.

##VBS##

In VBScript, you can release the Application object reference explicitly by setting the variable value to null. Again, don't forget to call the Application object's Quit method if you're using an out-of-process server:

app.Quit  'only needed for out-of-process servers
Set app = Nothing 'VBScript does this for you when variable goes out of scope


Creating A TurboCAD Drawing Using CreateObject

Similarly to how you create an Application object, you can use object creation methods to create TurboCAD Drawing objects. In standard OLE andCOM terms, the Drawing object is a document. When you create a document using CreateObject (in Visual Basic), CoCreateInstance (in C++) or new ActiveXObject (in VBScript), the TurboCAD engine will automatically force the creation of an Application object, which will then be called upon to create the Drawing object that is returned to you. Hence the discussion on creating Application objects also applies to this method of creating Drawing objects. If you are primarily interested in creating new drawings, and don't care about methods on the Application object, this can be used as a shortcut:

Dim dwg As Object
Set dwg = CreateObject(, "TurboCAD.Drawing")

All examples discussed for creating and accessing Application objects can be easily modified to create Drawing objects by replacing "IMSIGX.Application" with "IMSIGX.Drawing" or CLSID_Application with CLSID_Drawing.

If you don't explicitly create an Application object, the server will shut down when all of the Drawing and other references you create go out of scope or are explicitly released. In the out-of-process server case, you should still call the Application object's Quit method.

Is this correct? Verify with a test program.


Saving Drawings

A backup copy of the drawing file, as well as summary info and preview are created for a drawing only if the TurboCAD application runs in out-of-process server mode. If you want backup copies made for in-process servers, it is up to you as the programmer to call the Drawing object's SaveAs method.


Closing a Drawing

The Drawing.Close method takes an optional Boolean parameter named SaveChanges. The SaveChanges parameter works only when TurboCAD Application is run in local server mode. If this parameter evaluates to True, TurboCAD will check if the drawing has been modified since last save, and if it has, will display a Save Changes dialog box will be presented. If the drawing is a new one that has not yet been saved to disk as a file, clicking the Yes button in the dialog box will open a Save As dialog box.


Using View Objects

Each drawing created in TurboCAD when it runs in out-of-process server mode has at least one default view.

In a standalone application that uses TurboCAD engine as in-process server (i.e. as COM or ActiveX component) a newly created Drawing object will not have default View object associated with it. To be able to display a Drawing object in a window or to be able to output it to a printing or any other device, you need to create a View associated with this Drawing object and specify its properties (see below).

After you have created a View object you can access it using the Drawing object's View collection. You need to keep track of each View hWnd or hDC property, since it is the only way to identify a unique view in an application.

If you plan to use VBA to create your standalone application (for instance to access TurboCAD from MS Excel spreadsheet or MS Access database as an in-process server), you might find it problematic to display a TurboCAD drawing in a VBA form or control (see the Using The View Object topics in the Exploring in Depth section). A preferable approach would be to create a custom hWnd-aware ActiveX control using C++, VB, or any other development language to display a TurboCAD drawing in a standalone VBA application.

After you have finished with a View you have created, you may destroy it using the Delete method. You should never destroy intrinsic TurboCAD View objects (those not created by your own explicit code). However, you can safely destroy View objects that you have created by the Add method of the Views collection.


Managing Active Drawings and Views

If the TurboCAD engine is accessed as in-process server in your custom application, you need to take care of creating or using control windows, and then creating and attaching View objects in which you can display TurboCAD drawings. In this case TurboCAD knows nothing of a currently active drawing object, i.e. it's up to you to determine which drawing window is considered as active. The TCADX sample project shows one way to maintain these attachments.

In the out-of-process server case, the TurboCAD EXE application keeps track of which drawing and view has the focus, and updates the ActiveDrawing and ActiveView properties for you.


Handling TurboCAD Events

TurboCAD fires a set of events at predetermined times that you can receive by writing an Automation client that can be written using any Automation-compatible development system. These events indicate to a client of the TurboCAD engine when specific actions are about to occur, or when they have finished. For example when you make a change to the selection, the TurboCAD engine fires a "SelectionChange" event, and passes information about the location and contents of the selection back to the client.

The client, often called an "event sink" in Microsoft documentation, can receive any or all of the predefined events that are documented in the SDK reference. By trapping these events, your client application or ActiveX control can keep track of TurboCAD's current drawing, the current selection, the currently running tool, etc., and keep any data structures or user interface features in your client up to date.

You can choose to handle any subset of the full suite of 31 available events by specifying a number called the "event mask", which is the sum of the following constants:

              imsiEventBeforeExit = 1
              imsiEventDrawingNew = 2
              imsiEventDrawingOpen = 4
              imsiEventDrawingActivate = 8
              imsiEventDrawingDeactivate = 16
              imsiEventDrawingBeforeClose = 32
              imsiEventDrawingBeforeSave = 64
              imsiEventWindowResize = 128
              imsiEventWindowActivate = 256
              imsiEventWindowDeactivate = 512
              imsiEventMouseDown = 1024
              imsiEventMouseUp = 2048
              imsiEventMouseMove = 4096
              imsiEventBeforeDoubleClick = 8192
              imsiEventBeforeRightClick = 16384
              imsiEventSelectionChange = 32768
              imsiEventCommandBarControlHit = 65536
              imsiEventCommandBarControlStatus = 131072
              imsiEventRunTool = 262144
              imsiEventPointSnapped = 524288
              imsiEventPointPick = 1048576
              imsiEventRectanglePick = 2097152
              imsiEventPolygonPick = 4194304
              imsiEventViewBeforeRedraw = 8388608
              imsiEventViewAfterRedraw = 16777216
              imsiEventVirtualIntersectionPick = 33554432
              imsiEventCommandBarControlDone = 67108864
              imsiEventDrop = 134217728
              imsiEventCancel = 268435456
              imsiEventUpdateUndo = 536870912
              imsiEventDrawingAfterSave = 1073741824


Handling TurboCAD Events in Visual Basic Projects

To handle TurboCAD events in Visual Basic, you must first create a class module (CLS file) or form (FRM file). When you create a class module or form, Visual Basic exposes the class module or form's methods and properties through the IDispatch Automation interface that is required to connect and handle events.

To create a class module to hande TurboCAD events, choose Add | Class Module in the VB Editor, and name the new class module "modEvents".

Then add the necessary event handler methods (as public subroutines) to your class module. You only need to add the handlers for the events you want to receive. Make sure that the methods you do define exactly match the names and parameters listed below:

Public Sub BeforeDoubleClick(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Sel As IMSIGX.Selection, Cancel As IMSIGX.IMSI_BOOL)
Public Sub BeforeExit(ByVal TheApp As IMSIGX.IApplication, Cancel As IMSIGX.IMSI_BOOL)
Public Sub BeforeRightClick(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Sel As IMSIGX.Selection, Cancel As IMSIGX.IMSI_BOOL)
Public Sub DrawingActivate(ByVal WhichDrawing As IMSIGX.IDrawing)
Public Sub DrawingAfterSave(ByVal WhichDrawing As IMSIGX.IDrawing)
Public Sub DrawingBeforeClose(ByVal WhichDrawing As IMSIGX.IDrawing, Cancel As IMSIGX.IMSI_BOOL)
Public Sub DrawingBeforeSave(ByVal WhichDrawing As IMSIGX.IDrawing, SaveAs As IMSIGX.IMSI_BOOL, Cancel As IMSIGX.IMSI_BOOL)
Public Sub DrawingDeactivate(ByVal WhichDrawing As IMSIGX.IDrawing)
Public Sub DrawingNew(ByVal WhichDrawing As IMSIGX.IDrawing)
Public Sub DrawingOpen(ByVal WhichDrawing As IMSIGX.IDrawing)
Public Sub Drop(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Sel As IMSIGX.Selection)
Public Sub MouseDown(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Button As IMSIGX.ImsiMouseButton, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As IMSIGX.IMSI_BOOL)
Public Sub MouseMove(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As IMSIGX.IMSI_BOOL)
Public Sub MouseUp(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Button As IMSIGX.ImsiMouseButton, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As IMSIGX.IMSI_BOOL)
Public Sub RunTool(ByVal WhichTool As IMSIGX.Tool)
Public Sub SelectionChange(ByVal WhichDrawing As IMSIGX.IDrawing, ByVal WhichView As IMSIGX.View, ByVal WhichWindow As IMSIGX.Window, ByVal Sel As IMSIGX.Selection)

Check for missing signatures

After you have saved the class module, edit your project's main module. Declare and construct an instance of your event handling class module in a global variable. Use the As New syntax to create the instance in a variable called eventHandler as follows (assuming your class module is named modEvents):

Private eventHandler As New modEvents

By creating a global variable and using the As New syntax, Visual Basic will only create your instance when it is first used, and will keep the single instance in memory for as long as your application is running.

Finally, after you have connected to the TurboCAD engine's Application object, you signal that you are ready to receive events, by invoking the Application's ConnectEvents method. The Mask parameter tells the TurboCAD engine which events to send your client. There is a const number for each event. You add them together to generate the mask. For example:

Dim app As IMSIGX.Application
Set app = CreateObject(, "IMSIGX.Application")
Dim eventMask As Long
eventMask = imsiEventMouseDown + imsiEventMouseUp
Dim eventId As Long
' Start handling mouse down and mouse up events
eventId = app.ConnectEvents(eventHandler, eventMask)

After the connection to your handler class module has been established, your class module's handler methods will be called whenever the particular event is fired. In the example above, the module's MouseDown and MouseUp subroutines will be the only ones called, because of the value passed as the Mask parameter to ConnectEvents. When you want to stop handling events, you call the Application object's DisconnectEvents method, and pass in the eventId that tells the Application which handler is being disconnected:

' We're finished with events
app.DisconnectEvents eventId

The TCADX example project illustrates this connection process in more detail.


Handling TurboCAD Events in Visual C++ Projects

##CPP##

This document will describe in step-by-step detail how to write an event sink application using Microsoft Visual C++ 4.0 or later, using the Microsoft Foundation Classes (MFC) framework, with additional support for the Automation dual interface. Using dual interfaces will permit better performance in future releases of the TurboCAD SDK, and is very easy to implement using two helper files provided by Microsoft. Other development systems (such as VC++ and the ActiveX Template Library), or straight C or C++ Windows and COM SDK programming can accomplish the same task.

Components

Using MFC, the Events demo application source code was generated using the following steps:

AppWizard created an Automation-enabled, dialog-based MFC EXE, together with the source files for the CWinApp derived main application class, CTCEventsApp, and the main dialog class, CTCEventsDlg, as well as standard make files, resource files, etc.

ClassWizard was then used to add automation properties and methods to the CTCEventsApp class. In this way, skeleton code was added to Events.h, Events.cpp and the Events.odl interface definition file.

Controls were added to the CTCEventsDlg dialog using the Visual C++ dialog editor, and button click handlers were added using ClassWizard. A message handler was added by hand, to process the checkbox notification messages sent by the event mask checkboxes.

Support for Automation dual interface was added to CTCEventsApp class, using macros provided in MfcDual.h.

What the Events Demo Application Does

The demo application is designed to monitor TurboCAD. When executed, it presents a dialog to the user. By pressing the "Connect to Events" button, the application will try to connect to an active running instance of TurboCAD , or if none is active, it will start up TurboCAD, using the COM system call CoCreateInstance. After the application object is successfully attached, a call to a TurboCAD SDK method, IApplication::ConnectEvents, passes the IDispatch pointer of our client application to TurboCAD, allowing TurboCAD to send us events. After establishing the connection, the button's caption will change to "Disconnect."

ConnectEvents takes a Mask parameter that tells TurboCAD what subset of the full event suite we are interested in. This mask is set up by the state of the checkboxes on the dialog. To monitor a particular event, check the control with its name. To stop monitoring the event, uncheck the corresponding control. If the event connection has already been made, each check and uncheck will disconnect and establish a new connection with the new mask. Pressing the "Disconnect" button forces a disconnect. Pressing "Exit Application" disconnects both the event monitor, and forces TurboCAD to shut down. Pressing "Close" cleans up the connection if open, and closes the dialog.

As events are fired, they are passed to the client application's IDispatch pointer through Automation. Each event received is processed by a separate handler function, which sends a Windows message to the edit control on the dialog to append a line of text describing the event. A real event handler would update its data structures or present some user interface that might interact with TurboCAD.

AppWizard, ClassWizard and MFC's Automation Support

Review this for applicability to VC++ 6.

The version of AppWizard that ships with Visual C++ is somewhat constrained in its support for enabling Automation. Normally, the only class that it enables is the CDocument derived class, and this is only set up correctly, if you choose a non-dialog-based application. In fact you can add full MFC and ClassWizard Automation support to any class that derives from CCmdTarget. In our case, in order to keep the number of files small and the design simple, and since we did not intend to create documents or views, we chose a dialog-based application, and then manually jump-started the ClassWizard to allow us to Automation enable our application class. The steps we had to take were as follows:

Edit the .odl file.

Edit the CTCEvents.h file.

Edit the CTCEvents.cpp file.

Now the CTCEvents class can take advantage of ClassWizard to add properties and methods. We used ClassWizard to mimic the TurboCAD SDK's IAppEvents interface, substituting LPDISPATCH parameters for TurboCAD interfaces, and BOOL parameters for TurboCAD's IMSI_BOOL. Using ClassWizard has the advantage of maintaining the .odl, .h and .cpp files through a (relatively) simple user interface.

Making Your Project a TurboCAD Event Sink

To add a TurboCAD event sink to any CCmdTarget derived class, take the following steps.

Copy the following lines verbatim from CTCEvents.h into the header file for your CCmdTarget-derived class (we'll call it CTCMonitor). These are the member functions that your class must implement in order to process TurboCAD events:

// Generated OLE dispatch map functions
//{{AFX_DISPATCH(CTCMonitor)
afx_msg void BeforeExit(LPDISPATCH TheApp, BOOL FAR* Cancel);
afx_msg void DrawingNew(LPDISPATCH WhichDrawing);
afx_msg void DrawingOpen(LPDISPATCH WhichDrawing);
afx_msg void DrawingActivate(LPDISPATCH WhichDrawing);
afx_msg void DrawingDeactivate(LPDISPATCH WhichDrawing);
afx_msg void DrawingBeforeClose(LPDISPATCH WhichDrawing, BOOL FAR* Cancel);
afx_msg void DrawingBeforeSave(LPDISPATCH WhichDrawing, BOOL FAR* SaveAs, BOOL FAR* Cancel);
afx_msg void WindowResize(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow);
afx_msg void WindowActivate(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow);
afx_msg void WindowDeactivate(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow);
afx_msg void MouseDown(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, short Button, long Shift, long X, long Y);
afx_msg void MouseUp(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, short Button, long Shift, long X, long Y);
afx_msg void MouseMove(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, long Shift, long X, long Y);
afx_msg void BeforeDoubleClick(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, LPDISPATCH Sel, BOOL FAR* Cancel);
afx_msg void BeforeRightClick(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, LPDISPATCH Sel, BOOL FAR* Cancel);
afx_msg void SelectionChange(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, LPDISPATCH Sel);
afx_msg void CommandBarControlHit(LPDISPATCH WhichControl, BOOL FAR* Cancel);
afx_msg void CommandBarControlStatus(LPDISPATCH WhichControl);
afx_msg void RunTool(LPDISPATCH WhichTool);
afx_msg void PointSnapped(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, long XScreen, long YScreen, LPDISPATCH PointRaw, LPDISPATCH PointSnapped);
afx_msg void PointPick(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH Result, BOOL PickWasCanceled);
afx_msg void RectanglePick(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH Result, BOOL PickWasCanceled);
afx_msg void PolygonPick(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH Result, BOOL PickWasCanceled);
afx_msg void ViewBeforeRedraw(LPDISPATCH WhichDrawing, LPDISPATCH WhichView);
afx_msg void ViewAfterRedraw(LPDISPATCH WhichDrawing, LPDISPATCH WhichView);
afx_msg void VirtualIntersectionPick(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH PickResult, BOOL WasCanceled);
afx_msg void CommandBarControlDone(LPDISPATCH WhichControl);
afx_msg void Drop(LPDISPATCH WhichDrawing, LPDISPATCH WhichView, LPDISPATCH WhichWindow, LPDISPATCH Selection);
//}}AFX_DISPATCH
DECLARE_DISPATCH_MAP()
DECLARE_INTERFACE_MAP()

Check for missing signatures

Copy the following lines verbatim into your CCmdTarget-derived implemenation (.cpp) file. This "dispatch map" is used by MFC to perform late binding via the IDispatch::Invoke mechanism, so that the member functions get called with the correct parameters:

BEGIN_DISPATCH_MAP(CTCMonitor, CCmdTarget)
//{{AFX_DISPATCH_MAP(CTCMonitor)
DISP_FUNCTION(CTCMonitor, "BeforeExit", BeforeExit, VT_EMPTY, VTS_DISPATCH VTS_PBOOL)
DISP_FUNCTION(CTCMonitor, "DrawingNew", DrawingNew, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "DrawingOpen", DrawingOpen, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "DrawingActivate", DrawingActivate, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "DrawingDeactivate", DrawingDeactivate, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "DrawingBeforeClose", DrawingBeforeClose, VT_EMPTY, VTS_DISPATCH VTS_PBOOL)
DISP_FUNCTION(CTCMonitor, "DrawingBeforeSave", DrawingBeforeSave, VT_EMPTY, VTS_DISPATCH VTS_PBOOL VTS_PBOOL)
DISP_FUNCTION(CTCMonitor, "WindowResize", WindowResize, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "WindowActivate", WindowActivate, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "WindowDeactivate", WindowDeactivate, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "MouseDown", MouseDown, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_I2 VTS_I4 VTS_I4 VTS_I4)
DISP_FUNCTION(CTCMonitor, "MouseUp", MouseUp, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_I2 VTS_I4 VTS_I4 VTS_I4)
DISP_FUNCTION(CTCMonitor, "MouseMove", MouseMove, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_I4 VTS_I4 VTS_I4)
DISP_FUNCTION(CTCMonitor, "BeforeDoubleClick", BeforeDoubleClick, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_PBOOL)
DISP_FUNCTION(CTCMonitor, "BeforeRightClick", BeforeRightClick, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_PBOOL)
DISP_FUNCTION(CTCMonitor, "SelectionChange", SelectionChange, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "CommandBarControlHit", CommandBarControlHit, VT_EMPTY, VTS_DISPATCH VTS_PBOOL)
DISP_FUNCTION(CTCMonitor, "CommandBarControlStatus", CommandBarControlStatus, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "RunTool", RunTool, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "PointSnapped", PointSnapped, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_I4 VTS_I4 VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "PointPick", PointPick, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_BOOL)
DISP_FUNCTION(CTCMonitor, "RectanglePick", RectanglePick, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_BOOL)
DISP_FUNCTION(CTCMonitor, "PolygonPick", PolygonPick, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_BOOL)
DISP_FUNCTION(CTCMonitor, "ViewBeforeRedraw", ViewBeforeRedraw, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "ViewAfterRedraw", ViewAfterRedraw, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "VirtualIntersectionPick", VirtualIntersectionPick, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_BOOL)
DISP_FUNCTION(CTCMonitor, "CommandBarControlDone", CommandBarControlDone, VT_EMPTY, VTS_DISPATCH)
DISP_FUNCTION(CTCMonitor, "Drop", Drop, VT_EMPTY, VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH VTS_DISPATCH)
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

Check for missing signatures

static const IID IID_IAppEvents =
{ 0x6A481301, 0xE531, 0x11CF, { 0xA1, 0x15, 0x0, 0xA0, 0x24, 0x15, 0x8D, 0xAF } };
BEGIN_INTERFACE_MAP(CTCMonitor, CCmdTarget)
INTERFACE_PART(CTCMonitor, IID_IAppEvents, Dispatch)
END_INTERFACE_MAP()

Copy the event sink member function implementations into the same file, and then add your own implementations. For example:

void CTCMonitor::BeforeExit(LPDISPATCH TheApp, BOOL FAR* Cancel)
{
// Do something here
}

The .odl file is not strictly necessary, since the IID_IAppEvents interface ID is defined in, and registered with, the TurboCAD SDK.

Make sure to include "GxIntf.h" and "IMSIGx.h" header files (which define IID_IAppEvents).

Call CCmdTarget::EnableAutomation in your object's constructor, or any place in your code before you make the IApplication::ConnectEvents call to TurboCAD. See the Events.cpp source file for more details.

Use CCmdTarget::GetIDispatch(TRUE) to obtain the LPDISPATCH pointer to pass to TurboCAD in ConnectEvents. See the EventDlg.cpp source file for more details.

Support for Dual Interfaces in MFC

Two additional files, MfcDual.h and MfcDual.cpp, extend the Automation support offered in Visual C++ to include support for dual interfaces. Dual interfaces permit Automation clients to short cut the IDispatch::Invoke method and call servers more directly (in the case of an in-process server) via a function pointer, resulting in a performance increase. Even though there is not much to gain in the case of local server communication (as in our case, where the demo application and TurboCAD are in effect both local servers), we added this dual interface support to show how it's done. For more information, see the MFC Technical Note 65, "TN065: Dual-Interface Support for OLE Automation Servers".

ATL samples?


Handling TurboCAD Events using VBScript

##VBS##

In VBScript you can declare classes. To handle TurboCAD events in VBScript, you declare a class (we'll name it TCEvents) and define the handler methods as functions. You must name the functions and list the parameters exactly as given below, although you only need to define functions for those events you intend to handle:

class TCEvents
public function BeforeExit(TheApp, Cancel)
public function DrawingNew(WhichDrawing)
'put your handler code here
public function DrawingOpen(WhichDrawing)
'put your handler code here
public function DrawingActivate(WhichDrawing)
'put your handler code here
public function DrawingDeactivate(WhichDrawing)
'put your handler code here
public function DrawingBeforeClose(WhichDrawing, Cancel)
'put your handler code here
public function DrawingBeforeSave(WhichDrawing, SaveAs, Cancel)
'put your handler code here
public function WindowResize(WhichDrawing, WhichView, WhichWindow)
'put your handler code here
public function WindowActivate(WhichDrawing, WhichView, WhichWindow)
'put your handler code here
public function WindowDeactivate(WhichDrawing, WhichView, WhichWindow)
'put your handler code here
public function MouseDown(WhichDrawing, WhichView, WhichWindow, Button, ShiftKeys, X, Y)
'put your handler code here
public function MouseUp(WhichDrawing, WhichView, WhichWindow, Button, ShiftKeys, X, Y)
'put your handler code here
public function MouseMove(WhichDrawing, WhichView, WhichWindow, ShiftKeys, X, Y)
'put your handler code here
public function BeforeDoubleClick(WhichDrawing, WhichView, WhichWindow, Sel, Cancel)
'put your handler code here
public function BeforeRightClick(WhichDrawing, WhichView, WhichWindow, Sel, Cancel)
'put your handler code here
public function SelectionChange(WhichDrawing, WhichView, WhichWindow, Sel)
'put your handler code here
public function CommandBarControlHit(WhichControl, Cancel)
'put your handler code here
public function CommandBarControlStatus(WhichControl)
'put your handler code here
public function RunTool(WhichTool)
'put your handler code here
public function PointSnapped(WhichDrawing, WhichView, XScreen, YScreen, PointRaw, PointSnapped)
'put your handler code here
public function PointPick(WhichDrawing, WhichView, Result, PickWasCanceled)
'put your handler code here
public function RectanglePick(WhichDrawing, WhichView, Result, PickWasCanceled)
'put your handler code here
public function PolygonPick(WhichDrawing, WhichView, Result, PickWasCanceled)
'put your handler code here
public function ViewBeforeRedraw(WhichDrawing, WhichView)
'put your handler code here
public function ViewAfterRedraw(WhichDrawing, WhichView)
'put your handler code here
public function VirtualIntersectionPick(WhichDrawing, WhichView, PickResult, PickWasCanceled)
'put your handler code here
public function CommandBarControlDone(WhichControl)
'put your handler code here
public function Drop(WhichDrawing, WhichView, WhichWindow, Selection)
'put your handler code here
end class

Check for missing signatures

The event handling class is instantiated and connected to the Application object in much the same way as in Visual Basic. See the HtmlScriptPack example project for more information.


Building Standalone Custom TurboCAD Applications

Using the TurboCAD SDK, it is easy to build small applications that give users the ability to use simple subsets of TurboCAD's functionality. The SDK contains some simple examples of how you can "write your own CAD program." You can easily add sophisticated editing, interaction with databases, and other features to build applications and controls that can be tailored for specific uses.

NOTE If you are interested in selling or otherwise distributing custom applications built with the SDK, you must obtain a developer license from IMSI. A sample agreement form can be found here. If you have questions about the terms and limitations of your SDK license, please contact IMSI.

Building CAD Programs Using Visual Basic

The TCADX and Preview Visual Basic example projects give a quick introduction on how you can interact with Drawing and View objects using a Visual Basic Form that contains a PictureBox control. The PictureBox's client window is used to connect to the TurboCAD View object, and mouse clicks in the PictureBox are intercepted and used to select, move or modify drawing contents.

To create a new project for making a standalone TurboCAD application in Visual Basic, make sure to follow these steps:

  • Choose "??" as your project type
  • Reference the TurboCAD type library
  • Other build and project settings?
  • Add your code
  • Compile your application
  • Test and debug your application

Building CAD Programs Using Visual C++

##CPP##

The LTSample Visual C++ example project is an MFC application that shows how to use many of the functions available in the TurboCAD SDK to build a highly interactive application.

To create a new project for making a standalone TurboCAD application in Visual C++, make sure to follow these steps:

  • Choose an appropriate project type, based on your desired development framework, either "Win32 Application", "MFC AppWizard (exe)", or "ATL/WTL AppWizard".
  • Add the path for the TurboCAD SDK's header files to your project's C++ preprocessor settings
  • Other build and project settings?
  • Add your code
  • Compile your application
  • Test and debug your application


Deploying Custom TurboCAD Applications

When you have built and tested your application, make sure that your installation includes all necessary DLL's, placed in the correct directories, and that your installation process registers the TurboCAD object library correctly. Also make sure that you install the any required runtime DLL's. For Visual Basic 6.0 projects you must make sure to include vbrun32.dll. For MFC applications, you will need to include mfc42.dll. Other runtime DLL's might also be required.

Finally, if you plan on distributing your application to other users, make sure that you have obtained a developer license from IMSI. A sample agreement form can be found here. If you have questions about the terms and limitations of your SDK license, please contact IMSI.


Building TurboCAD ActiveX Controls

Using the TurboCAD SDK, you can build ActiveX controls. These are DLL's that enable you to put TurboCAD functionality on a web page, so that you can load, edit, save, and view CAD data over the web.

NOTE If you are interested in selling or otherwise distributing ActiveX controls built with the SDK, including making your server-hosted controls available for download to web clients, you must obtain a developer license from IMSI. A sample agreement form can be found here. If you have questions about the terms and limitations of your SDK license, please contact IMSI.

Building ActiveX Controls Using Visual Basic

The TCViewX Visual Basic example project shows how to attach a drawing's view to the control window, and use the View object's Refresh method to paint the control.

Building ActiveX Controls Using Visual C++

##CPP##

The OCXDemo Visual C++ example project is an MFC-based ActiveX control that you can use as a basis for building your own controls.

To create a new project for making a standalone TurboCAD application in Visual C++, make sure to follow these steps:

  • Choose an approprate project type, based on your desired development framework, either "Win32 Dynamic-Link Library", "MFC ActiveX Control Wizard", or "ATL COM AppWizard".
  • Add the path for the TurboCAD SDK's header files to your project's C++ preprocessor settings
  • Make sure to include a version resource
  • Other build and project settings?
  • Add your code
  • Compile your application
  • Test and debug your application


Deploying TurboCAD ActiveX Controls

Once built and tested, you must follow all the recommendations and requirements described in the Deploying Standalone Applications section. Since TurboCAD ActiveX controls hosted on a remote web server require that multiple DLL's be downloaded and registered on the client machine, they are usually packaged in a CAB file that contains deployment and registration information. In addition, you may want to purchase a security certificate that will help users to confirm or reject the installation of your ActiveX control.

In particular, any TurboCAD ActiveX control you build that will be placed on a web server accessible to multiple users must be covered by a developer license obtained from IMSI. A sample agreement form can be found here. If you have questions about the terms and limitations of your SDK license, please contact IMSI.


Extending TurboCAD with Custom Extensions

SDK extensions are Automation servers that extend the functionality of TurboCAD. There are three types of extensions that are currently supported: custom Regen objects, file filters, tools, ties and palettes.

Custom Regen objects allow third parties to develop constraints and other custom logic for graphic elements of a drawing.

File filters allow new file types to be edited by TurboCAD, and new export formats to be created from any drawing that TurboCAD can edit. Both custom Regen object and file filter extensions will work with the in-process server version of the SDK, so that you can build a custom application that uses your extensions, as well as extend the capabilities of TurboCAD as a standalone application or local server.

Tool extensions allow you to install new commands into TurboCAD's user interface, and so are not useful for extending the in-process server.

Tie extensions allow you to create and maintain inter-object dependencies between different types of graphics in a drawing. For example, associative dimensions (dimensions that stick to the object or objects they dimension) are implemented as a custom tie.

Palette extensions are resizable windows that you can dock in TurboCAD's palette area, and with which you can build interfaces that work in tandem with TurboCAD.

Any development environment that supports building COM server DLL's can build a TurboCAD extension. This includes Visual Basic and Visual C++. Each extension server DLL must expose a coclass with a default IDispatch interface that conforms to a particular set of methods and properties for the appropriate extension type. In addition, the DLL must contain a single COM type library that describes the coclass (creatable object type) and its IDispatch interface. Tie extensions are unique among extension types in that they must expose a VTBL (early binding) interface, called ITurboCADSmartTieServer as their default interface.

On startup, the TurboCAD engine tries all the DLL's in specific named subdirectories, looking for DLL's with appropriate type libraries, and registers these DLL's by creating objects in the collections of the Application object. For custom Regen objects, a RegenMethod object is added to the Application's RegenMethods collection. For file filters, a Filter object is added to the Application's Filters collection. For tools, a Tool object is added to the Application's Tools collection. Tie extensions cause a TieMethod object to be added to the Application's TieMethods collection. Palettes do not expose an object in the Application's collections, since a palette is always identified by its window handle.


Creating Custom Regen Objects

Custom Regen objects are the technology that TurboCAD uses to allow the creation and maintenance of graphic entities that contain rules to constrain or modify their states based on geometry and other attributes. By writing your own Custom Regen objects, you can create an infinite variety of graphics which exhibit specific behaviors. The SDK provides several sample Custom Regen object extensions written in a variety of languages for you to begin with.

Custom Regen objects are Automation servers, where the TurboCAD engine is the client. A custom Regen object server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, specified by the IRegenServer interface, necessary to support the custom Regen objects that they control.

Custom Regen object extensions are loaded when the server first starts up. To be successfully loaded, a custom Regen object extension DLL must be located in the Regens subdirectory of the TurboCAD engine's Program directory. Each module (DLL) in this directory is queried for a COM type library that tells TurboCAD what extensions are served by the module. Then the module's automation object or objects are created. For each installed Regen object server (whether built-in or a custom Regen object created by a programmer), TurboCAD creates a corresponding RegenMethod object that is added to the Application object's RegenMethods collection.

On initialization, the custom Regen object server tells TurboCAD the number and types of properties that its graphic supports. Later, TurboCAD will call on the Custom Regen object server to store and retrieve these properties, and more importantly, will ask the custom Regen object server to "regen" its graphics when they have been modified by users. This regen process allows the Custom Regen object server to maintain its graphics using its own logic.

The custom Regen object must implement an IDispatch or dual interface that includes all the methods and properties of the IRegenServer interface:

IRegenServer Properties
Property | Description
ClassID | A String returning the unique identifier for this server.
Description | A String giving a short, human readable description for the server.
IRegenServer Methods
Method | Description
Initialize | Called first, at startup time. This method lets your server create and initialize any necessary internal data structures.
GetPropertyInfo | Called at startup time. Tells the TurboCAD engine the names, types, local IDs, and default values of the extra properties that your custom Regen objects will support.
GetEnumNames | Called at startup time. Tells the TurboCAD engine the name-to-value mapping for any enumeration value type properties.
GetPageInfo | Called at startup time. Tells the TurboCAD engine the captions of the property pages that your server will provide to support property editing. Also tells the TurboCAD engine what stock property pages (such as "Pen", "Brush", "Text") your custom Regen objects will want the TurboCAD engine to expose.
PropertyPages | Called to initialize and start a single property page.
PageControls | Called during property page editing to synchronize the values held on the property page with the object or objects being edited. Depending on the SaveProperties parameter, the object is updated with the properties on the page, or the page controls are updated based on the object's property values.
PageDone | Called after property page editing has been completed and the page has been closed, so that your server can release any temporary memory.
OnNewGraphic | Called when TurboCAD is creating a new Graphic object. Your OnNewGraphic method will fill in the vertices, child graphics, and set up any initial property values, then return TRUE to indicate the successful creation. This method is also called during copying of Graphics, if there is any special referencing or manipulation to be carried out.
OnCopyGraphic | Called when TurboCAD is copying one of your Graphic objects. Usually there is no special processing your server needs to do, except to return TRUE to permit the copying to proceed.
OnGeometryChanging | Called before the TurboCAD engine will modify an object's geometry. Return TRUE to permit the modification to proceed.
OnGeometryChanged | Called after the geometry modification has been performed.
OnPropertyChanging | Called before the TurboCAD engine will modify a property of an object. Return TRUE to permit the modification to proceed.
OnPropertyChanged | Called after the property modification has been performed.
OnPropertyGet | Called when TurboCAD needs to read one of a Graphic's properties, in case your server needs to perform any calculations.
Regen | Called before TurboCAD needs to display or get information about one of your Graphic objects. This is the method that usually adds or updates child cosmetic Graphic objects, based on the property values of the parent object.
Draw | Called when TurboCAD needs to draw one of your Graphic objects, in case there are special features that you need to draw. In most cases, your Graphic's cosmetic child graphics will have been set up correctly so that they will display your Graphic's appearance appropriately.
GetWizardInfo | Not used.
Wizard | Not used.
GetDistance | Not used.
CalcBoundingBox | Not used.


Coding a Custom Regen Object

In Visual Basic, the Rounded Rectangle and Coordinate Text are explained by tutorials that provide step-by-step instructions for creating them. We will refer to these examples as we explore some key concepts in building your own custom regen objects.


Exposing Custom Regen Object Properties

Usually you're the Graphic objects that your server will manage will expose one or more custom properties. Your server can define any number and type of these properties that you wish. In the simple case of our RRect example, you let the built-in TurboCAD Graphic object define most of the standard properties, such as "Line Type", "Pen Color", etc. You supply just one property "Roundness", that will define the radius of the rounded corners of the rectangle. In this example, you specify Roundness as a percentage (a double value from 0 to 100), to avoid any dependency on the height or width of the rectangle. The default value for Roundness will be 50.

Defining Properties and Property Pages

You tell TurboCAD about this property in the GetPropertyInfo method. First you define a constant, NUM_PROPERTIES, to indicate the number (1) of properties you are going to add, and a local integer ID value, idRoundness, that will be used when TurboCAD is communicating with our server about the Roundness property. Then you re-dimension and fill in the information about the property:

Const NUM_PROPERTIES = 1
Const idRoundness = 1
Public Function GetPropertyInfo(Names As Variant, Types As Variant, _
    IDs As Variant, Defaults As Variant) As Long
    ReDim Names(NUM_PROPERTIES), Types(NUM_PROPERTIES), _
        IDs(NUM_PROPERTIES), Defaults(NUM_PROPERTIES)
    Names(0) = "Roundness"
    Types(0) = typeDouble
    IDs(0) = idRoundness
    Defaults(0) = 50#
    GetPropertyInfo = NUM_PROPERTIES
End Function

Since you also need to support a user interface for editing this property, you build a user form with a text box on it to display the value of the property, and then tell TurboCAD the caption of this form in our GetPageInfo method:

'Stock property pages
Const ppStockPen = 1
Const ppStockBrush = 2
Const ppStockText = 4
Const ppStockInsert = 8
Const ppStockViewport = 16
Const ppStockAuto = 32
Const NUM_PAGES = 1
Public Function GetPageInfo(ByVal AGraphic As Object, StockPages As Long, _
    Names As Variant) As Long
    ReDim Names(NUM_PAGES)

    'Need the form
    Load frmRRect
    Names(0) = frmRRect.Caption
    Unload frmRRect

    StockPages = ppStockBrush + ppStockPen + ppStockAuto
    GetPageInfo = NUM_PAGES
End Function

Here, GetPageInfo also is telling TurboCAD that you want to expose the standard Brush, Pen, and Automation property pages, by returning a flag in the StockPages parameter.

Displaying and Synchronizing Property Pages

Now that TurboCAD knows about our property and the page that it is edited on, you need to actually implement the editing and synchronization code. When the user right-clicks on one of our RRect Graphics and chooses "Edit Properties", she will see a property dialog containing the stock Pen, Brush pages, and the Caption "Round Rectangle" that you supplied in the GetPageInfo method. When she clicks on this tab, our PropertyPages method will be called. This is the time for us to display the form:

Public Function PropertyPages(ByVal ThisRegenMethod As Object, Optional PageNumber As Variant) As Boolean
    With frmRRect
        .Show vbModal
        PropertyPages = Not .DialogCanceled
    End With
End Function

When the form first comes up, or when the user has clicked on the Apply button, or tabbed to another page on the form, our PageControls method will be called. Depending on the value of the SaveProperties parameter, you either update our Graphic's properties or update the display on the form:

Public Function PageControls(ByVal ThisRegenMethod As Object, ByVal Graphic As Object, ByVal PageNumber As Long, ByVal SaveProperties As Boolean) As Boolean
        'Set up error function
        On Error GoTo Failed

        Dim Roundness#
        If SaveProperties Then
            'OK button on property page was clicked
            'Form is still loaded
            With frmRRect
                'Need On Error statement for the case where you have
                'RRect Turbo Shape and ahother "shape" selected
                On Error Resume Next

                'When the property page is closed, transfer the numeric
                'roundness value from the TextBox to the Graphic
                'Get the value as a double-precision number
                Roundness# = CDbl(.txtRoundness.Text)
                'Make sure it's between 0 and 100
                If Roundness# < 0# Then Roundness# = 0#
                If Roundness# > 100# Then Roundness# = 100#
                'Set the roundness property value in the Graphic
                Graphic.Properties("Roundness") = Roundness#
            End With
        Else
            'Property page is about to be opened
            'Make sure the form is loaded
            Load frmRRect
            With frmRRect
                'If more than one RRect is selected and they do not
                'have the same properties, don't set up this field
                On Error GoTo NoRType

                'When the property page is opening, transfer the numeric
                'roundness value from the Graphic to the TextBox
                'Get the roundness property value from the Graphic
                Roundness# = Graphic.Properties("Roundness")
                'Set the TextBox control's text
                .txtRoundness.Text = Roundness#
NoRType:
            End With
        End If

        PageControls = True
        Exit Function

Failed:
        'For debugging purposes, report that an error occurred
        If Err.Number <> 0 Then
            MsgBox "Error in PageControls: " & Err.Description
        End If

        'Return false if an error occurred
        PageControls = False
End Function

Finally, when TurboCAD is completely finished using our property page (usually when the user dismisses the entire property dialog), our PageDone method is called. Here you can safely unload our form:

Public Function PageDone(ByVal ThisRegenMethod As Object, Optional PageNumber As Variant)
        'Done with form
        Unload frmRRect
End Function

Responding to Property Change and Get Requests

For the other property-related methods, OnPropertyChanging, OnPropertyChanged, and OnPropertyGet, you don't need to do anything special, so you use the "default" behavior:

'Notification function called after graphic property is saved
Public Function OnPropertyChanged(ByVal Graphic As Object, ByVal PropID As Long, _
        ValueOld As Variant, ValueNew As Variant)
    'Do nothing
End Function

'Notification function called when graphic property is saved
Public Function OnPropertyChanging(ByVal Graphic As Object, ByVal PropID As Long, _
        ValueOld As Variant, ValueNew As Variant) As Boolean
    'OK to proceed
    OnPropertyChanging = True
End Function

'Notification function called when graphic property is retrieved
Public Function OnPropertyGet(ByVal Graphic As Object, ByVal PropID As Long)
    'Do nothing
End Function

That's all that you need to do to support custom properties! Of course, more sophisticated objects could use these notifications to refuse the change of particular properties under certain conditions, or to return a property value based on calculations, rather than stored values.


Setting up Custom Graphics

Two methods, OnNewGraphic and OnCopyGraphic, are responsible for initializing the contents of your custom Graphic objects. In the RRect case, we build a Graphic that will contain four Vertex objects to define the geometry: the first two to define the corners of the rectangle, the third to define the calculated roundness point (a "handle" that we will calculate based on the location of the rectangle and the Roundness property), and the fourth to define a user-movable handle that can be manipulated using the TurboCAD node-edit selector to change the roundness. To create a "default" object we define the rectangle to be bounded by the points (-1, -0.5, 0) and (1, 0.5, 0), and place the calculated and movable roundness handles at the same location, (0.75, 0.6, 0), as shown below:

Public Function OnNewGraphic(ByVal grfThis As Object, ByVal boolCopy As Boolean) As Boolean
    If boolCopy Then
        'Vertices are already added for us...
        OnNewGraphic = True
        Exit Function
    End If

    On Error GoTo Failed
    'New Graphic being created
    'X, Y, Z, PenDown, Selectable, Snappable, Editable, Linkable
    'First Vertex is "lower left" corner
    grfThis.Vertices.Add -1#, -0.5, 0#, False, True, False, False, False
    'Second Vertex is "upper right" corner
    grfThis.Vertices.Add 1#, 0.5, 0#, False, True, False, False, False
    'Third Vertex is rounding handle (calculated)
    Dim R#, Roundness#, Offset#
    Roundness# = grfThis.Properties("Roundness")
    R# = 0.5 * Roundness# / 100#
    Offset# = 0.1 * R#
    grfThis.Vertices.Add 1# - R#, 0.5 + Offset#, 0#, False, False, False, False, False
    'Fourth Vertex is rounding handle (editable)
    grfThis.Vertices.Add 1# - R#, 0.5 + Offset#, 0#, False, True, False, True, False
    grfThis.Properties("LimitVertices") = 4
    OnNewGraphic = True
    Exit Function

Failed:
    'Return false on failure
    OnNewGraphic = False
End Function

One minor detail to notice is the LimitVertices property. This built-in property of all TurboCAD graphics tells the engine that this Graphic should never have more than four vertices.

The OnCopyGraphic method is just used to signal that TurboCAD can always make copies of our RRect graphics:

Public Function OnCopyGraphic(ByVal grfCopy As Object, ByVal grfSource As Object) As Boolean
    'Return false on failure
    OnCopyGraphic = True
End Function

You can also use OnCopyGraphic to do any special setup of the newly copied Graphic object or its geometry or properties that depends on information stored in the original Graphic.

Using Vertex Flag Properties

In addition to setting the Cosmetic flag on the Graphic objects that the Regen object server controls, the Regen object server may also manipulate flags on the Graphic's contained Vertex objects, in order to signal specific behavior to the TurboCAD engine. Each flag represents a particular aspect of the vertex. In the case of the four vertices specified in the OnNewGraphic method, note that all are specified with PenDown:=False, Snappable:=False, and Linkable:=False. This is because we don't want these vertices drawing line segments, used for snaps or for links (i.e. dimensions). Those features will be given to our Graphic by the cosmetic graphic children when our Regen method is called.

Note that the vertices that we want our user to see in the selection (the lower left, upper right, and movable handle) have their Selectable flag set to True, and that the movable handle also has the Editable flag set to True, so that it can be picked in node-edit mode.


Creating and Using Cosmetic Graphics During Regen

The key principle that most Regen objects take advantage of is the cosmetic Graphic. This is a graphic that the Regen object server adds to the drawing with the Cosmetic property set to True. When the user modifies a property of the Graphic, the Regen object server updates the cosmetic Graphic object appropriately. The Cosmetic flag tells the TurboCAD engine that the geometry of the Graphic can be reconstructed at any time from Graphic's other properties, thanks to the logic contained in the Regen object server.

Normally the time to create or update these cosmetic Graphics is in your server's Regen method implementation. TurboCAD uses a "lazy" system, calling your server's Regen method only when necessary (such as when making one of your server's objects visible).

In the RRect object server, the Regen method is responsible for two things:

  • Detecting whether the roundness handle was moved by the user, and thus whether the Roundness property needs to be updated
  • Creating the cosmetic child Graphic objects that draw the rounded rectangle, based on the location of the rectangle definition corners and the Roundness factor.

The Regen method does not have to concern itself with code to scale, rotate or transform the vertices in the parent, non-cosmetic, Graphic. Nor does it need to explicitly destroy the existing cosmetic children-this is all handled by the TurboCAD engine itself.

Here is the code for the RRect object server's Regen method:

'Called when we need to update our object
Public Function Regen(ByVal grfThis As Object)
        'Setup error handler
        On Error GoTo Failed

        'grfThis.Application.PushVertexDefaults Editable:=True, Selectable:=True

        'Set up lock (prevent recursion)
        Dim LockCount&
        LockCount& = grfThis.RegenLock

        'Setup error handler (make sure lock is removed)
        On Error GoTo FailedLock
        If LockCount& = 0 Then
            'Delete any previous cosmetic children
            grfThis.Graphics.Clear gfCosmetic

            Dim boolHandleMoved As Boolean

            'Calculate height, width and radius of corners
            Dim W#, H#, R#, Roundness#
            With grfThis.Vertices
                If (Abs(.Item(2).X - .Item(3).X) < 0.000001 And _
                    Abs(.Item(2).Y - .Item(3).Y) < 0.000001) Then
                    boolHandleMoved = False
                Else
                    boolHandleMoved = True
                End If
                W# = Abs(.Item(1).X - .Item(0).X)
                H# = Abs(.Item(1).Y - .Item(0).Y)
            End With
            'Radius of arcs is based on minimum of width and height
            If W# < H# Then
                R# = W# / 2#
            Else
                R# = H# / 2#
            End If
            'Adjust radius for roundness
            If boolHandleMoved Then
                Roundness# = Abs(grfThis.Vertices(2).X - grfThis.Vertices(3).X)
                Roundness# = Roundness# * 100# / R#
                If Roundness# > 100# Then Roundness# = 100#
                'Relocate handle

                'Update property to reflect handle location
                grfThis.Properties("Roundness") = Roundness#
            Else
                Roundness# = grfThis.Properties("Roundness")
                If Roundness# < 0# Then Roundness# = 0#
                If Roundness# > 100# Then Roundness# = 100#
            End If
            R# = R# * Roundness# / 100#

            'Add child Graphics
            Dim grfChild As Object
            Dim X0#, Y0#, X1#, Y1#, T#
            With grfThis.Vertices
                X0# = .Item(0).X
                Y0# = .Item(0).Y
                X1# = .Item(1).X
                Y1# = .Item(1).Y
                'Make sure X0 < X1
                If (X0# > X1#) Then
                    T# = X0#
                    X0# = X1#
                    X1# = T#
                End If
                'Make sure Y0 < Y1
                If (Y0# > Y1#) Then
                    T# = Y0#
                    Y0# = Y1#
                    Y1# = T#
                End If
            End With
            If R# = 0# Then
                'No rounded corners
                'All children are cosmetic
                Set grfChild = grfThis.Graphics.Add(gkGraphic)
                grfChild.Cosmetic = True
                'Now add vertices to the child
                With grfChild.Vertices
                    .Add X0#, Y0#, 0
                    .Add X0#, Y1#, 0, True
                    .Add X1#, Y1#, 0, True
                    .Add X1#, Y0#, 0, True
                    'Close the rectangle
                    .AddClose PenDown:=True 'PenDown
                End With
            Else
                'Rounded corners
                'We'll make 4 line children and 4 arc children
                'First line
                'All children are cosmetic
                Set grfChild = grfThis.Graphics.Add(gkGraphic)
                grfChild.Cosmetic = True
                'Now add vertices to the child
                With grfChild.Vertices
                    .Add X0# + R#, Y0#, 0
                    .Add X1# - R#, Y0#, 0, True
                End With
                'First arc
                Set grfChild = grfThis.Graphics.Add(gkArc)
                grfChild.Cosmetic = True
                grfChild.ArcSet X1# - R#, Y0# + R#, 0#, R#, , 1.5 * Pi#, 0#
                'Second line
                Set grfChild = grfThis.Graphics.Add(gkGraphic)
                grfChild.Cosmetic = True
                With grfChild.Vertices
                    .Add X1#, Y0# + R#, 0
                    .Add X1#, Y1# - R#, 0, True
                End With
                'Second arc
                Set grfChild = grfThis.Graphics.Add(gkArc)
                grfChild.Cosmetic = True
                grfChild.ArcSet X1# - R#, Y1# - R#, 0#, R#, , 0#, 0.5 * Pi#
                'Third line
                Set grfChild = grfThis.Graphics.Add(gkGraphic)
                grfChild.Cosmetic = True
                With grfChild.Vertices
                    .Add X1# - R#, Y1#, 0
                    .Add X0# + R#, Y1#, 0, True
                End With
                'Third arc
                Set grfChild = grfThis.Graphics.Add(gkArc)
                grfChild.Cosmetic = True
                grfChild.ArcSet X0# + R#, Y1# - R#, 0#, R#, , 0.5 * Pi#, Pi#
                'Fourth line
                Set grfChild = grfThis.Graphics.Add(gkGraphic)
                grfChild.Cosmetic = True
                With grfChild.Vertices
                    .Add X0#, Y1# - R#, 0
                    .Add X0#, Y0# + R#, 0, True
                End With
                'Fourth arc
                Set grfChild = grfThis.Graphics.Add(gkArc)
                grfChild.Cosmetic = True
                grfChild.ArcSet X0# + R#, Y0# + R#, 0#, R#, , Pi#, 1.5 * Pi#
            End If

            'Add visible child Graphics
        End If

        grfThis.RegenUnlock
        'grfThis.Application.PopVertexDefaults
        Exit Function

FailedLock:
        'Remove lock
        grfThis.RegenUnlock

Failed:
        'grfThis.Application.PopVertexDefaults

        If Err.Number <> 0 Then
'            MsgBox "Regen error: " & Err.Description
        End If
End Function

In this example, the code determines whether it needs to create a single rectangle polygon child Graphic (in the case where the Roundness factor is zero), or a group of four lines and four arcs. In either case, the child Graphics are created in the parent Graphic's Graphics collection, Vertices added to them, and the Cosmetic flag is set to True for each of the children.

The other important thing to note is that all of the operations in the Regen method are bracketed by a beginning call to Graphic.RegenLock and an ending call to Graphic.RegenUnlock. Each call to a the RegenLock method increments a counter in the Graphic object, and the subsequent RegenUnlock decrements this counter. By examining the return value of RegenLock, and only touching the contents of the Graphic when the counter is zero, you can prevent any manipulation of the Graphic's properties and geometry from calling your Regen method over and over again. Failure to use RegenLock and RegenUnlock in this way will most likely result in a crash, due to a recursion of infinite depth.


Installing and Debugging Custom Regen Object Servers

To install the custom Regen object server, you just place the compiled server DLL in the Regens subdirectory of the TurboCAD engine's Program directory. When TurboCAD starts up, it tries to load a type library resource in the DLL. If it finds one, it opens the type library, discovers any coclasses, and attempts to create server object instances by calling CoCreateInstance. Then methods and properties on the server object instance are called to obtain the information necessary for the engine to create a RegenMethod object: the Initialize method is called, so that the Regen object server can perform any startup tasks, the ClassID and Description properties are read.

To debug a Regen object server that was written in Visual Basic, you can place the VBP (Visual Basic Project) file in the Regens subdirectory, and delete the compiled DLL. TurboCAD supports VB debugging by also looking for files with a .VBP extension and trying to load them.

##CPP##

To debug Regen object servers in C++, you can place breakpoints in your source code, and specify TurboCAD as the debugging application. You should see the object creation code called first, and the other initialization steps follow later. If your Regen object server is never called, check to make sure that the type library resource has been properly added to your DLL.


Creating Custom Filters

File filters are extension objects that TurboCAD uses to read graphic information from disk into the current drawing, or to save the current drawing to disk. The SDK provides several sample file filter extensions written in a variety of languages for you to learn from.

File filters, like Custom Regen objects, are Automation servers, where the TurboCAD engine is the client. A file filter server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, necessary to support the filters (typically one for each file extension) that they control.

File filter extensions are loaded when the server first starts up. To be successfully loaded, a file filter extension DLL must be located in the Filters subdirectory of the TurboCAD engine's Program directory. Each module (DLL) in this directory is queried for a type library that tells TurboCAD what extensions are served by the module. Then the module's automation object or objects are created. For each installed filter server (whether built-in or a custom filter object created by a programmer), TurboCAD creates a corresponding Filter object that is added to the Application object's Filters collection.

On initialization, the filter server gives TurboCAD an information string that describes the file extension, the string that will appear in the file open and file save dialogs, and some flags that control the matching algorithm that TurboCAD uses when searching for a filter that matches a particular file type. Then, when the user chooses to open or save a file, TurboCAD will call on the file filter server to process the input or output of the current drawing.

The filter server object must implement an IDispatch or dual interface that includes all the methods and properties of the IFilterServer interface:

Check methods against filterserver.idl file

IFilterServer Properties
Property | Description
Info | A String giving a list of fields that give a human readable description for the file type handled by the server, the file name extensions handled, and a priority number for the case where multiple filters exist for the same extension.
LastError | A String that represents the error or errors encountered during the last Check, Read or Write operation.
IFilterServer Methods
Method | Description
Initialize | Called first, at startup time. This method lets your server create and initialize any necessary internal data structures.
ReadSetup | Called when the user clicks on the Setup… button when opening a file handled by our filter. This method allows you to display a dialog for the user to make any preferences required.
CheckFlat | Called when the user selects a file to open. This method allows you to read a few bytes of the file to determine whether it is of the right type.
ReadFlat | Called when the user selects a file to open. This method is responsible for creating and the Graphic objects to the new drawing.
PreviewFlat | Called when the user selects a file to open. This method allows you to create a StdPicture object that will be displayed in the Open File dialog.
WriteSetup | Called when the user clicks on the Setup… button when saving a file handled by our filter. This method allows you to display a dialog for the user to make any preferences required.
WriteFlat | Called when the user selects a file to save. This method is responsible for creating the file based on the Graphic objects contained in the current TurboCAD drawing.


Coding a Filter

Written in Visual Basic, the FP3 filter reads Floor Plan Plus 3D files (another IMSI drawing format). JPEG is a Visual C++ output filter that writes the current drawing out as a JPEG file. For detailed information, consult the comments in the source files.


Installing and Debugging Filters

To install and debug your custom filter, follow the guidelines given in the section "Installing and Debugging Custom Regen Object Servers", placing the filter DLL in the Filters subdirectory of the TurboCAD engine's Program directory.


Creating Custom Tools

Tools are extension objects that TurboCAD incorporates into its user interface, as persistent commands that can be activated through menu items and toolbar buttons. Tools are maintained in TurboCAD on a stack, with the "active" tool at the top of the stack. The SDK provides a sample tool extension project, written in Visual Basic, to give you an idea of how to implement tools.

Tool servers are Automation servers, where the TurboCAD engine is the client. A tool server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, necessary to support the tool architecture.

Tool extensions are loaded when TurboCAD first starts up. To be successfully loaded, a tool extension DLL must be located in the Draggers subdirectory of the TurboCAD engine's Program directory. Each module (DLL) in this directory is queried for a type library that tells TurboCAD what extensions are served by the module. Then the module's automation object or objects are created. For each installed tool object server, TurboCAD creates a corresponding Tool object that is added to the Application object's Tools collection.

On initialization, the tool server gives TurboCAD information strings that describe the user interface properties of the tool: menu item string, status bar prompts, etc. When the user pulls down a menu the tool object's UpdateToolStatus is invoked to set the enabled and checked state of the menu item. When the user selects the tool on a menu or toolbar, the tool object's Run method is invoked to perform the tool's actions.

The tool server object must implement an IDispatch or dual interface that includes all the methods and properties of the IToolServer interface:

IToolServer Properties
Property | Description
Description | A String giving a short, human readable description for the server.
IToolServer Methods
Method | Description
Initialize | Called at startup. Your method can create any necessary internal data structures.
GetToolInfo | Called at startup. Tells TurboCAD the user interface information necessary to integrate your tool into TurboCAD's menus and toolbars, such as the menu and submenu names, toolbar names, "tool tip" strings, and whether the tool commands are initially enabled or require update messages.
GetPicture | Called at startup. Returns a strip of toolbar button images of requested size and color depth corresponding to individual tool commands, as a StdPicture object.
GetLMPicture | Called at startup. Returns a strip of button images corresponding to the local menu items that appear in the Inspector Bar, as a StdPicture object.
UpdateToolStatus | Called by the TurboCAD engine to query the server for the enabled and checked state of the tool.
Run | Called by the TurboCAD engine to execute a tool command.
DoLMCommand | Called by the TurboCAD engine after the user has selected an item in the tool's local menu (right-click context menu).
CopyBitmap | Not used.


Coding a Tool

Written in Visual Basic, the Inet tool checks to see if the current selection has a "URL" custom property. If so the tool opens a Web browser page to the selection's URL. If no "URL" property exists on the current selection, then the browser is opened on http://www.imsisoft.com.

##CPP##

The InsertFile tool is another example that shows how to code a tool. When run, this tool inserts symbols into the current drawing. InsertFile also shows how to integrate a custom Regen object server and tool.


Integrating a Tool into TurboCAD's User Interface

The GetToolInfo method implemented by your tool server is responsible for telling TurboCAD where to insert your tool server's individual commands in the TurboCAD menu structure, and provides other information about the tool commands. GetToolInfo dimensions and returns six arrays that specify the characteristics of all the tool commands supported by your server.

The CommandNames array is a one- or two-dimensional array. If your server sets this up as a one-dimensional array, each item in the array specifies the menu "path" string for the command. The submenu names are separated by the pipe character, '|'. If the array is dimensioned as a two-dimensional array, the second index in the array contains the following strings:

CommandNames 2nd Index
Index | Description
0 | Menu path for this command as described above.
1 | Style name for default Graphic created by this command.
2 | Graphic type for Graphic created by this command.
3 | RegenMethod name for Graphic created by this command.

The MenuCaptions array is a one- or two-dimensional array. If your server sets this up as a one-dimensional array, each item in the array specifies the menu item string and ALT-key shortcut, using the Win32 menu resource convention of preceding the shortcut key letter by the ampersand character, '&'.

If the array is dimensioned as a two-dimensional array, the second index in the array contains the following strings:

MenuCaptions 2nd Index
Index | Description
0 | Menu item for this command as described above.
1 | Toolbar name for toolbar containing this command.

The StatusPrompts array is a one- or two-dimensional array. If your server sets this up as a one-dimensional array, each item in the array specifies the string that will appear in TurboCAD's status bar when the command is executing.

If the array is dimensioned as a two-dimensional array, the second index in the array contains the following strings:

MenuCaptions 2nd Index
Index | Description
0 | Status bar prompt for this command as described above.
1 | Decimal value of the help context id for this command in the TurboCAD main help file, as a string.

The ToolTips array is a one-dimensional array, where each item in the array contains the text displayed in the pop-up "tool tip" when the user hovers the mouse over the command's toolbar icon.

The Enabled array is a one-dimensional array, where each item in the array contains a True or False value that indicates whether the command is initially available to the user.

The WantsUpdates array is a one-dimensional array, where each item in the array contains a True or False value that indicates whether the command's enabled or checked status may change depending on the selection state or other program state changes. By setting this value to True, your server will receive update messages before the menus and toolbars are displayed.

For example, here is the GetToolInfo method for the Inet sample (a server that only implements one command):

Const NUM_TOOLS = 1
Public Function GetToolInfo(CommandNames As Variant, MenuCaptions As Variant, StatusPrompts As Variant, _
    ToolTips As Variant, Enabled As Variant, WantsUpdates As Variant) As Long
    ReDim CommandNames(NUM_TOOLS)
    ReDim MenuCaptions(NUM_TOOLS, 2)
    ReDim StatusPrompts(NUM_TOOLS)
    ReDim ToolTips(NUM_TOOLS)
    ReDim Enabled(NUM_TOOLS)
    ReDim WantsUpdates(NUM_TOOLS)
    CommandNames(0) = "SDK|Hyperlink"
    MenuCaptions(0, 0) = "&Hyperlink"
    MenuCaptions(0, 1) = "SDK" ' toolbar name
    StatusPrompts(0) = "Launch a browser on the World Wide Web"
    ToolTips(0) = "Hyperlink"
    Enabled(0) = True
    WantsUpdates(0) = False
    GetToolInfo = NUM_TOOLS
End Function

Providing Toolbar Button Images

In addition to return string information that tells TurboCAD where to insert menu items for tool commands in its menus, your server can also provide a strip of toolbar button images, which TurboCAD will use to insert buttons into specified toolbars. The GetPicture method is responsible for return image strips in two sizes. Each button image should be 16 pixels wide by 15 pixels high for small buttons, and 24 pixels wide by 23 pixels high for large buttons, and should use a 256-color (8-bit indexed color) bitmap.

You make a horizontal strip of these button images, with one image for each command listed in the GetToolInfo method, and then return the image strip as a StdPicture object. In Visual Basic, you can either load the bitmap image strips from .BMP files, or from bitmap resources contained in your server's DLL.

The TurboCAD engine will build enabled and disabled button graphics based on the bitmap images you return in the GetPicture method. TurboCAD uses the magenta RGB color (R=255, G=0, B=255) to indicate the transparent background that the button image will be extracted from, so make sure that your image strip uses magenta for its background color, and that no part of the image that you want to be part of the button graphic contains magenta pixels, or else this part will appear transparent when shown on the TurboCAD toolbars.

Updating Tool Command Status

If you want to present more sophisticated feedback to the user, you can control the enabled and checked state of your tool commands. In your GetToolInfo method, make sure to set the value of the WantsUpdates array item to True. Then implement the UpdateToolStatus, setting the values Enabled and Checked to True or False depending on the state of the program. For example you might check that the current drawing's Selection object contains specific graphic types before setting the Enabled value of your tool command to True. If you have multiple, exclusive commands, you might check to determine which command is active and set the Checked value accordingly, as is done in the Bool2D sample:

Public Function UpdateToolStatus(ByVal Tool As Object, Enabled As Boolean, Checked As Boolean) As Boolean
    Enabled = True 'Could do a test here to determine whether to disable the button/menu item
    If iConnectId = -1 Then
        Checked = False  'Could do a test here to determine whether to check the button/menu item
    Else
        If Tool.Index = iActTool Then
            Checked = True
        Else
            Checked = False
        End If
    End If
    UpdateToolStatus = True
End Function


Performing a Tool Command's Function

The Run method of your tool server is called when the user clicks on your tool command's toolbar button, or chooses the corresponding menu item. Run, like many of the methods in your tool server, passes you a reference to the currently active Tool object. You can perform any checking or manipulation of data that you wish in this method. The Inet sample launches a browser based on the contents of the selection when the Run method is called, using the Tool object that is passed to the method to find the selection:

Public Function Run(ByVal Tool As Object) As Boolean
    Dim objApp As Object
    Dim objSel As Object
    Dim objGraphic As Object
    Dim strURL As String
    On Error Resume Next

    'Look for first URL property in the selection
    Set objApp = Tool.Application
    Set objSel = objApp.Selection
    For Each objGraphic In objSel
        strURL = ""
        strURL = objGraphic.Properties("URL")
        If strURL <> "" Then
            StartBrowser strURL
            Run = True
            Exit Function
        End If
    Next objGraphic

    'No selection or no URLs: just start browser at a convenient home page
    StartBrowser "http://www.imsisoft.com/"
    Run = True
End Function

What is RunTool?


Implementing Multi-State Tool Commands

If your tool command's functionality requires more than a simple mouse click or menu shortcut key to execute, you will need to intercept TurboCAD events and implement a "state machine" that keeps track of the current state of the command and the events caused by user action. Such multi-state commands also usually need to change the status bar string and can add items to local menus (right-click context menus) that can change depending on the state of the command. This section will highlight some of the steps involved in implementing multi-state commands. For more details, see the Bool2D example project.

Tracking TurboCAD Events

As described in the section "Handling TurboCAD Events", your tool server can implement a class module that will receive event notifications, so that you can act on user mouse, keyboard and other actions appropriately. Your tool server should connect to the TurboCAD event system as explained, and maintain the event connection as long as necessary.

If you are writing a multi-state command, you probably want to inform the user what to do, based on the current state of your command. The TurboCAD Application object exposes an interface named IToolEvents that gives you more control over the status bar. The IToolEvents interface you obtain contains two methods that multi-state commands can use to update the user interface as the user makes transitions betweens tool command states:

Describe methods

IToolEvents Methods
Method | Description
ToolChangePrompt |
ToolChangeCommands |

To use the IToolEvents interface, you can "coerce" the interface from the Application object. In the Bool2D example, a global variable is used to hold the IToolEvents interface. It is set up in the Initialize method, and torn down in the class module's Terminate method:

Private theToolEvents As IToolEvents
Public Function Initialize(ByVal Tool As Object) As Boolean
On Error GoTo ErrorHandler
    Set objApp = Tool.Application
    Set theToolEvents = objApp
    Initialize = True
ErrorHandler:
End Function

##CPP##

To obtain the IToolEvents interface using C++, you use the standard COM QueryInterface method, or one of its smart pointer equivalents:

IApplication* pApp = NULL;
IToolEvents* pToolEvents = NULL;
HRESULT hr;
hr = pTool->get_Application(&pApp);
if (SUCCEEDED(hr))
    hr = pApp->QueryInterface(IID_IToolEvents, (void**)&pToolEvents);

Updating the Status Bar Prompt

Once you have obtained a reference to the Application object's IToolEvents interface, you can update the text in the status bar dynamically by calling the IToolEvents.ToolChangePrompt method, passing the string that you want to display:

theToolEvents.ToolChangePrompt Me, "Select First graphic", False

Adding Local Menus for a Tool's Commands

Multi-state commands also usually provide right-clickable context menus, or "local menus", that give the user finer control over the actions he might take during the execution of a tool command. The IToolEvents.ToolChangeCommands method gives you the ability to add and remove your own custom menu items at any time. You pass four arrays to ToolChangeCommands, representing the menu item captions, the corresponding status bar prompts, and the current enabled and checked states of the menu items. The Bool2D example contains a private function that performs this updating:

Private Function AddLM(bAdd) As Boolean
Dim Captions(0 To 0) As String
Dim Prompts(0 To 0, 0 To 1) As String
Dim Enabled(0 To 0) As Boolean
Dim Checked(0 To 0) As Boolean

 Dim varCaptions As Variant
 Dim varPrompts As Variant
 Dim varEnabled As Variant
 Dim varChecked As Variant
    If (bAdd) Then
        Captions(0) = LoadResString(116) '"Finish Boolean2D"
        Prompts(0, 0) = LoadResString(116) '"Finish Boolean2D"
        If iActTool = 0 Then
            Prompts(0, 1) = "95140"
        End If
        If iActTool = 1 Then
            Prompts(0, 1) = "95141"
        End If
        If iActTool = 2 Then
            Prompts(0, 1) = "95142"
        End If
        Enabled(0) = True
        Checked(0) = False

        varCaptions = Captions
        varPrompts = Prompts
        varEnabled = Enabled
        varChecked = Checked
        theToolEvents.ToolChangeCommands Me, 1, varCaptions, varPrompts, varEnabled, varChecked, True
    Else
       theToolEvents.ToolChangeCommands Me, 0, , , , , False
    End If
End Function

You must make sure to remove all the local menu command items when your tool has finished executing, by passing zero as the second parameter to ToolChangeCommands, as shown in the code above (when bAdd is False).

Providing Local Menu Buttons for the Inspector Bar

If you are building a local menu using the ToolChangeCommands method, you probably also want to supply custom menu buttons for TurboCAD's Inspector Bar. To accomplish this, you implement the GetLMPicture method in your class module, and pass an image strip (small button size, 16 pixels wide by 15 pixels high) which contains one button image for each item in the local menu. The other requirements and conventions for TurboCAD toolbar button images, described in the section "Providing Toolbar Button Images" also apply to Inspector Bar button images.


Installing and Debugging Tools

To install and debug your custom tool, follow the guidelines given in the section "Installing and Debugging Custom Regen Object Servers", placing the tool DLL in the Tools subdirectory of the TurboCAD engine's Program directory.


Creating Custom Ties

Ties are extension objects that handle the association between two graphic objects. While you can create a great deal of specialized CAD functionality by developing custom Regen graphics, only by writing a tie server can you build logic that depends on the interaction of two or more graphics.

Tie servers are Automation servers, where the TurboCAD engine is the client. A tie server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, necessary to support the tie architecture.

Tie extensions are loaded when TurboCAD first starts up. To be successfully loaded, a tie extension DLL must be located in the Ties subdirectory of the TurboCAD engine's Program directory. Each module (DLL) in this directory is queried for a type library that tells TurboCAD what extensions are served by the module. Then the module's automation object or objects are created. For each installed tie object server, TurboCAD creates a corresponding TieMethod object that is added to the Application object's TieMethods collection.

Unlike the other extension server types, TurboCAD does not use the IDispatch (or "late-binding") method when communicating with tie servers. Instead these servers must implement the ITurboCADSmartTieServer COM interface, so that TurboCAD can use so-called VTBL (or "early-binding") for better performance.

Tie Servers and the TieSets, TieSet and Tie Objects

Each Drawing contains a TieSets collection, representing all the associations between graphics contained within the Drawing. Each TieSet item in the TieSets collection is a collection representing a group of related associations between a single pair of Graphic objects: the "subject" graphic and the "subordinate" graphic. The Tie server's job is to cause the subordinate Graphic to be modified when user actions change the geometry or properties of the subordinate graphic. For example, in the TextAlongCurve example, the curve or polyline graphic that the text follows is the subject, and the text elements that are displayed along the curve are the subordinate graphics. In some cases you want to make the two graphics in a particular tie equivalent. This is accomplished by establishing two ties, the subject and subordinate roles in one tie are reversed in the other.

The items in the TieSet collection are Tie objects. Each Tie object is single subject-subordinate relationship between specific parts of the two graphics.

In addition to specifying the two graphics involved in the association, Tie objects have a Priority property that establishes a ranking in case of conflict, and a Data property that holds the data that maintains the geometrical state of the Tie as the subordinate and subject Graphics change.

In some instances there are reciprocal subordinate-subject associations that can also affect the interaction of the two Graphics involved. The Tie server must negotiate these potentially conflicting interactions.

The Tie and TieSet associations are usually created by a custom tool, whose job it is to identify the subject and subordinate Graphic objects, create or find the TieSet that links the two graphics, and then create or update the Tie objects in the set, establishing the connection information based on user interaction. In addition, you can further implement special association behavior by building custom Regen objects for the subject and/or subordinate Graphics maintained in your ties.

Once a Tie is created or modified, the custom tie server responds to notifications by examining the Tie data and the state of the subordinate and subject Graphics.

Describe initialization, tie operation, subjects and subordinates

ITurboCADSmartTieServer Properties
Property | Description
Description | A String giving a short, human readable description for the server.
ITurboCADSmartTieServer Methods
Method | Description
Initialize | Called at startup. Your method can create any necessary internal data structures.
AddTie | Called whenever a new custom Tie is created.
DeleteTie | Called whenever a custom Tie is destroyed.
CopyTie | Called whenever a subject or subordinate Graphic (or both) in an existing Tie is copied.
UpdateTie | Called after subject Graphic has changed, so that server can update subordinate Graphic.
CanNODEED | Called just before TurboCAD runs a NodeEdit dragger, where the selection includes a Tie.
GetTypesInfo | Not used.
GetIDs | Not used.
SetIDs | Not used.


Coding a Tie

Because building interesting behaviors using ties can involve a considerable amount of logic, the documentation will provide information only about the most general aspects of writing a tie server. For detailed information consult the tie server examples that come with the SDK:

  • The VertexTie Tie example in Visual Basic provides a basic introduction to writing a custom tie server. The tie server connects. The ties are established by a VBA Macro also called VertexTie.
  • The TextAlongCurve Tie example requires a much more sophisticated approach to maintaining the tie information. The ties are created by a Visual Basic tool called TextAlongCurve.
  • The SurveyorCoordinate Tie example uses the tool to create the ties, and a custom "CoordReg" Regen type to display the coordinate data.

VTBL Binding and the ITurboCADSmartTieServer Interface

Since tie servers use VTBL binding, there are few differences from other extension types that must be observed when coding.

In Visual Basic you must make sure that the class module that implements your tie server contains the statement:

Implements ITurboCADSmartTieServer

In addition, the full suite of tie server methods and properties must be written using Visual Basic's naming conventions, so that the AddTie method is declared as:

Private Function ITurboCADSmartTieServer_AddTie(ByVal pIDispDwg As Object, ByVal idSbj As Long, ByVal idSbd As Long, ByVal lType As Long) As Boolean

Identifying Tie Servers

Each tie server must be uniquely named through its ProgID. In Visual Basic, the tie server's ProgID is derived from the project name and the class module name. For instance the ProgID for the VertexTie sample is "VertexTie.clsVertexTie". This ID string is the one that you specify when adding ties using the TieSets.Add and TieSet.AddTie methods.


Maintaining Private Data in a Custom Tie

Each tie server uses a user-defined data type to hold information that it needs to keep track of the tie. In the simplest case (as illustrated by the VertexTie example), this can be just the vertex indices of the particular vertices in the subject and subordinate graphics that will be tied together. More elaborate servers, such as the TextAlongCurve example, need to keep track of more information. In Visual Basic, you can declare the user defined type for your Tie's data using a Type statement block in your tie server class module. Here is the user-defined type from the TextAlongCurve example:

Public Type VertexTieData
    idVertPoly As Long ' define the least nearest index of segment's vertex on polygon
    xLocRelPrev As Double ' Previous local coordinate on line segment
    AnglePrev As Double ' Previous angle of line segment
    fiMidPrev As Double ' Previous angle for middle text point for Circle or Arc
    xcPrev As Double    ' Previous Xc for Circle or Arc
    ycPrev As Double    ' Previous Yc for Circle or Arc
    LFullPrev As Double     ' Previous full length for Curve or TCW50Polyline
    x0Prev As Double    ' Previous x0 for Curve or TCW50Polyline
    y0Prev As Double    ' Previous y0 for Curve or TCW50Polyline
    x1Prev As Double    ' Previous x1 for Curve or TCW50Polyline
    y1Prev As Double    ' Previous y1 for Curve or TCW50Polyline
    L0RelPrev As Double  ' Previous relative Length coordinate for the center vertex of the text
    L1RelPrev As Double ' Previous relative Length coordinate for the first bounded vertex of the text
    L2RelPrev As Double ' Previous relative Length coordinate for the first bounded vertex of the text
End Type

NOTE You are limited to using integers, floating point numbers, Boolean values and arrays of these types as fields in your user-defined type. String values are not currently supported by TurboCAD, and will cause errors.

Once defined, other modules (such as the tool that creates the tie, or a custom Regen object that is used by the tie) can access and modify this data. For instance, the TextAlongCurve example keeps track of the previous location of the tie by examining and modifying this data. These other modules do not need to declare or define the data type. Instead, they can access the fields of the user-defined type by simply using the field names. In Visual Basic, you can accomplish this as follows (code is from the TextAlongCurve tool):

Dim TSet As TieSet
Dim varData As Variant
Dim theTie As Tie
    Set theTie = TSet(0)
    varData = theTie.Data
Dim AnglePrev As Double
Dim ConVertex As Long
    ConVertex = varData(0).idVertPoly
    AnglePrev = varData(0).AnglePrev

Note that you receive a copy of the Tie object data in a Variant variable, and then must index this Variant (which is actually returned as an array of VertexTieData of length 1), before using the field name. When you have made changes to the the user-defined data, you can copy the data back to the Tie object as follows:

    theTie.Data = varData(0)


Creating Ties

When a client (usually a tool or macro) calls TieSets.Add with the ID of your tie server and a subject-subordinate graphic pair, the ITurboCADSmartTieServer_AddTie method of your server will be called. It is up to your server to actually create the tie by setting up the private tie data (as contained in your user-defined data type) and then calling TieSet.AddTie. In the VertexTie example, TieSets.Add is called twice, and the server detects this by checking to see if the TieSet specified by the subject and subordinate contains any Tie objects. The server actually constructs a reciprocal pair of Ties, swapping the subject and subordinate roles in the second Tie:

Private idVTie As String
Private gxTSets As TieSets
Private gxTSet  As TieSet
Private gxTie   As Tie
Private gxDwg   As Drawing
Private tieData As VertexTieDataPrivate
Function ITurboCADSmartTieServer_AddTie(ByVal pIDispDwg As Object, ByVal idSbj As Long, ByVal idSbd As Long, ByVal lType As Long) As Boolean
    Dim varData As Variant
    Set gxDwg = pIDispDwg

    Set gxTSets = gxDwg.TieSets
    Set gxTSet = gxTSets.TieSet(idSbj, idSbd)
    If (gxTSet.Count = 0) Then
        tieData.idVrtSbj = lType
        tieData.idVrtSbd = -1
        varData = tieData
        gxTSet.AddTie idVTie, 1, varData
    Else
        Set gxTie = gxTSet(0)
        varData = gxTie.Data
        tieData = varData(0)
        tieData.idVrtSbd = lType
        varData = tieData
        gxTie.Data = tieData
    End If

    Set gxTSet = gxTSets.TieSet(idSbd, idSbj)
    If (gxTSet.Count = 0) Then
        tieData.idVrtSbj = -1
        tieData.idVrtSbd = lType
        varData = tieData
        gxTSet.AddTie idVTie, 1, varData
    Else
        Set gxTie = gxTSet(0)
        varData = gxTie.Data
        tieData = varData(0)
        tieData.idVrtSbj = lType
        varData = tieData
        gxTie.Data = tieData
    End If

    UpdateTie gxTSet
    ITurboCADSmartTieServer_AddTie = True
    Clear

End Function


Updating Ties

Whenever a Graphic object that is the subject of a drawing's TieSet is modified, the TurboCAD engine calls the TieSet's server's ITurboCADSmartTieServer_UpdateTie method. In the VertexTie sample, this method just find the appropriate TieSet and delegates to a private function called UpdateTie (which is also called from the AddTie method):

Private Function ITurboCADSmartTieServer_UpdateTie(ByVal pIDispDwg As Object, ByVal idSbj As Long, ByVal idSbd As Long) As Integer
    Set gxDwg = pIDispDwg
    Set gxTSets = gxDwg.TieSets
    Set gxTSet = gxTSets.TieSet(idSbj, idSbd)
    UpdateTie gxTSet

    ITurboCADSmartTieServer_UpdateTie = 0
    Clear
End Function

The code in the UpdateTie method moves the vertex in the subordinate graphic so that it is located at the same position as the tied vertex in the subject graphic. It also redraws the modified subordinate graphic twice (erasing the old version of the graphic by temporarily setting the graphic's Deleted flag to True, and then drawing the graphic in its new configuration after the vertex has been moved):

Private Function UpdateTie(ByRef gxTSet As TieSet)

    Dim gxVrtSbj As Vertex
    Dim gxVrtSbd As Vertex
    Dim varData As Variant
    Dim gxGrSbdNew As Graphic

    Dim gxDwg As Drawing
    Dim hDwg As Long
    Dim hGrSbd As Long
    Dim idSbd As Long

    Set gxTie = gxTSet(0)

    varData = gxTie.Data
    tieData = varData(0)

    If (tieData.idVrtSbd <> -1 And tieData.idVrtSbj <> -1) Then

            Set gxGrSbj = gxTSet.Subject
            Set gxGrSbd = gxTSet.Subordinate

            Set gxVrtsSbj = gxGrSbj.Vertices
            Set gxVrtsSbd = gxGrSbd.Vertices

            gxVrtsSbj.UseWorldCS = True
            gxVrtsSbd.UseWorldCS = True

            Set gxVrtSbj = gxVrtsSbj(tieData.idVrtSbj)
            Set gxVrtSbd = gxVrtsSbd(tieData.idVrtSbd)

            gxGrSbd.Deleted = True
            gxGrSbd.Draw
            gxGrSbd.Deleted = False

            gxVrtSbd.X = gxVrtSbj.X
            gxVrtSbd.Y = gxVrtSbj.Y
            gxVrtSbd.Z = gxVrtSbj.Z

            gxGrSbd.Draw

            Set gxVrtSbd = Nothing
            Set gxVrtSbj = Nothing
            Set gxGrSbj = Nothing
            Set gxGrSbd = Nothing
    End If
End Function


Copying Ties

When TurboCAD copies the two graphics contained in a Tie, it calls your server's ITurboCADSmartTieServer_CopyTie method, so that you can make any adjustments to preserve important relationships in the copied objects. The VertexTie example needs to make sure that a new reciprocal Tie pair is established with the same private data (vertex information) as in the original. It does this by calling TieSets.Add on the copied graphics, which will invoke the tie creation process just as if an external client were creating the new Ties:

Private Function ITurboCADSmartTieServer_CopyTie(ByVal pIDispDwg As Object, ByVal idSbjSrc As Long, ByVal idSbdSrc As Long, ByVal idSbjTrg As Long, ByVal idSbdTrg As Long) As Boolean

    Set gxDwg = pIDispDwg
    Set gxGrs = gxDwg.Graphics
    Set gxGrSbj = gxGrs.GraphicFromID(idSbjTrg)
    Set gxGrSbd = gxGrs.GraphicFromID(idSbdTrg)

    Set gxTSets = gxDwg.TieSets
    Set gxTSet = gxTSets.TieSet(idSbjSrc, idSbdSrc)
    Set gxTie = gxTSet(0)
    tieData = gxTie.Data

    Set gxTSet = gxTSets.Add(idVTie, gxGrSbj, gxGrSbd, tieData.idVrtSbj, 0)

    Set gxTie = gxTSet(0)
    gxTie.Data = tieData

    Clear

    ITurboCADSmartTieServer_CopyTie = True
End Function


Destroying Ties

If one or the other of the graphics in a Tie are deleted, TurboCAD will call your server's ITurboCADSmartTieServer_DeleteTie method. This gives you a chance to make any adjustments necessary before your Tie is removed, and the private Tie data destroyed. The VertexTie example doesn't need to do any special processing here, so its implementation is empty:

Private Function ITurboCADSmartTieServer_DeleteTie(ByVal pIDispDwg As Object, ByVal idSbj As Long, ByVal idSbd As Long, ByVal pIDsipGr As Object) As Boolean
    ITurboCADSmartTieServer_DeleteTie = True
End Function


Installing and Debugging Tie Servers

To install and debug your custom tie server, follow the guidelines given in the section "Installing and Debugging Custom Regen Object Servers", placing the tie DLL in the Ties subdirectory of the TurboCAD engine's Program directory.


Adding a Tie from a Tool or Macro

Once you have created and installed your tie server, you can write a custom tool or VBA macro that will create the association between the subject and subordinate Graphics. To do this, you call the TieSets.Add method, passing the ProgID of the tie server, the two graphics and a user-definable Long value that will be passed to the tie server's ITurboCADSmartTieServer_AddTie method. In the VertexTie macro, the event handler captures mouse down events to select two graphics and then calls:

        gxTSets.Add "VertexTie.clsVertexTie", gxGrSbj, gxGrSbd, 0, 0
        gxTSets.Add "VertexTie.clsVertexTie", gxGrSbj, gxGrSbd, 1, 0


Creating Custom Palettes

Palettes are extension objects that handle the association between two graphic objects. Palette servers are Automation servers, where the TurboCAD engine is the client. A palette server creates one or more automation objects, through the standard COM creation system. Each automation object must support a standard suite of methods and properties, necessary to support the palette architecture.

Palette extensions are loaded when TurboCAD first starts up. To be successfully loaded, a palette extension DLL must be located in the Palettes subdirectory of the TurboCAD engine's Program directory. Each module (DLL) in this directory is queried for a type library that tells TurboCAD what extensions are served by the module. Then the module's automation object or objects are created. For each installed palette object server, TurboCAD creates a corresponding Palette object that is added to the Application object's Palettes collection.

Describe initialization, palette operation

The palette server object must implement an IDispatch or dual interface that includes all the methods and properties of the ITurboCADPaletteServer interface:

Describe methods

ITurboCADPaletteServer Properties
Property | Description
Description | A String giving a short, human readable description for the server.
Name |
HelpID |
Picture |
ITurboCADPaletteServer Methods
Method | Description
CreatePltWindow |
Query |


Coding a Palette

TODO


Installing and Debugging Palettes

TODO


Writing Scripts for the Internet Palette

TODO


Example Projects

All of the code examples that ship with the SDK are listed in the following sections. Each example page contains instructions on how you can build and run the program, as well as links to the text source code files, so that you can cut and paste source code directly from the documentation into your projects.

Projects are arranged by language/development environment, and then by the type of project:

Visual Basic for Applications Examples

These are simple and complex macros that run in the TurboCAD and Microsoft Office VBA system, allowing you to automate many procedures and perform data transfer into and out of TurboCAD.

Visual Basic Examples

These include standalone applications, ActiveX controls, a filter that saves data to the .XLS file format, custom "regen" graphics that let you create parametrically defined objects in your drawings, tie projects demonstrating how to link graphics together, and custom tools that extend the TurboCAD user interface to a level beyond simple macros.

Visual C++ Examples

In addition to all the types of projects included in the Visual Basic examples, this collection also includes an example of creating a custom palette server object that you can integrate into TurboCAD's palette user interface.

VBScript Examples

These examples show how to control TurboCAD using VBScript (one of a number of free scripting languages available for Windows programmers). The examples illustrate how you can create scriptlets embedded within HTML pages that ared designed to be used with TurboCAD's internet palette, and how you can control TurboCAD from the command line or GUI Windows Script Host controllers that are part of Windows 98, 2000, and XP.


Application Environment Macro Example

Description

This example shows TODO.

Components

AppEnv.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Basic Analysis Macro Example

Description

This example shows TODO.

Components

BasicAnalysis.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Blocks Macro Example

Description

This example shows TODO.

Components

Blocks.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Bolt Macro Example

Description

This example shows TODO.

Components

Bolt.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Camera Macro Example

Description

This example shows TODO.

Components

Camera.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Cloud Macro Example

Description

This example shows TODO.

Components

Cloud.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Common Macro Modules Example

Description

This example shows TODO.

Components

Common.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Bezier Curve Macro Example

Description

This example shows TODO.

Components

CurveBezier.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Double Line 2 Macro Example

Description

This example shows TODO.

Components

DblLine2.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Double Line Macro Example

Description

This example shows TODO.

Components

DblLine.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Edit Circle Macro Example

Description

This example shows TODO.

Components

EditCircle.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Events Macro Example

Description

This example shows TODO.

Components

Events.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


TurboCAD in Excel Macro Example

Description

This example shows TODO.

Components

Excel2.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Excel Import Macro Example

Description

This example shows TODO.

Components

ExcelImport.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Excel Topographic Data Macro Example

Description

This example shows TODO.

Components

Excel.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Extended Selection Info Macro Example

Description

This example shows TODO.

Components

ExtendedSelInfo.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Extrude Text Example

Description

This Visual Basic for Applications example shows how to create flexible text graphics, use the Explode method to convert a text graphic to polylines that represent the outlines of each character in the text, and to build 3D extrusions from each of the text characters. The TCM file contains one module with a single macro that produces the 3D extrusions in the active drawing.

Components

ExtrudeText.zip (Web link) Archive containing ExtrudeText.tcm VBA project.

Build Instructions

Download and unzip the archive. Add a new project named "ExtrudeText" to any TurboCAD drawing, and attach the ExtrudeText.tcm file. Run the CreateExtrudedText macro and observe the results, a series of 3D extrusions.


Gear Macro Example

Description

This example shows TODO.

Components

Gear.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Graphic Methods Macro Example

Description

This example shows TODO.

Components

Graphic.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Nut Macro Example

Description

This example shows TODO.

Components

Nuts.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Paper Space Macro Example

Description

This example shows TODO.

Components

PaperSpace.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Printing Macro Example

Description

This example shows TODO.

Components

Printing.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Selection Property Macro Example

Description

This example shows TODO.

Components

PropSel.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Rounded Rectangle Macro Example

Description

This example shows TODO.

Components

RRect.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Rendering Macro Example

Description

This example shows TODO.

Components

Render.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


LineStyles and BrushStyles Macro Example

Description

This example shows TODO.

Components

Styles.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Text Macro Example

Description

This example shows TODO.

Components

Text.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Title Block Example

Description

This Visual Basic for Applications example shows how to create a simple title block and set the drawing scale and units for a new drawing.

Components

TitleBlock.zip (Web link) Archive containing TitleBlock.tcm VBA project.

Build Instructions

Download and unzip the archive. Add a new project named "TitleBlock" to any TurboCAD drawing, and attach the TitleBlock.tcm file. Run the SetTitleBlock macro and observe the results: a simple title block is added to the drawing.


Vertex Methods Macro Example

Description

This example shows TODO.

Components

Vertex.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Viewport Macro Example

Description

This example shows TODO.

Components

ViewPort.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


XRef Macro Example

Description

This example shows TODO.

Components

XRef.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


File Converter Application Example

Description

This example shows TODO.

Components

Converter.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Matrix Example

Description

This example shows TODO.

Components

Matrix.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Preview Example

Description

This example shows TODO.

Components

Preview.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


TCADX Example

Description

This example shows TODO.

Components

TCADX.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


TurboCAD Viewer Example

Description

This example shows TODO.

Components

TCView.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Excel Filter Example

Description

This example shows TODO.

Components

ExcelFlt.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


3D Bolts Regen Example

Description

This example shows TODO.

Components

Bolt3D.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Bolts and Nuts Regen Example

Description

This example shows TODO.

Components

BoltNut.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Cable Regen Example

Description

This example shows TODO.

Components

Cable.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Connection Line Regen Example

Description

This example shows TODO.

Components

ConnectionLine.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Coord Text Regen Example

Description

This example shows TODO.

Components

CoordText.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Datum Target Regen Example

Description

This example shows TODO.

Components

DatumTarget.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Fastener Regen Example

Description

This example shows TODO.

Components

Fasteners.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Hole Regen Example

Description

This example shows TODO.

Components

Holes.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


3D Nut Regen Example

Description

This example shows TODO.

Components

Nut3d.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Gear Regen Example

Description

This example shows TODO.

Components

RGear.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


2D Nut Regen Example

Description

This example shows TODO.

Components

RNuts.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Rounded Rectangle Regen Example

Description

This example shows TODO.

Components

RRRect.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Tolerance Symbol Regen Example

Description

This example shows TODO.

Components

RegToler.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Roughness Symbol Regen Example

Description

This example shows TODO.

Components

Roughness.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Text Box Regen Example

Description

This example shows TODO.

Components

TextBox.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Welding Symbol Regen Example

Description

This example shows TODO.

Components

WeldingSymbol.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Radial Dimension Tie Example

Description

This example shows TODO.

Components

RadDimTie.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Vertex Tie Example

Description

This example shows TODO.

Components

VertexTie.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


2D Boolean Tool Example

Description

This example shows TODO.

Components

Bool2D.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


File Converter Tool Example

Description

This example shows TODO.

Components

FileConverterTool.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Gear Contour Tool Example

Description

This example shows TODO.

Components

GearContour.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Internet Hyperlink Tool Example

Description

This example shows TODO.

Components

Inet.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Joint Tool Example

Description

This example shows TODO.

Components

Joint.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Plane Figure Parameter Tool Example

Description

This example shows TODO.

Components

PlaneFigureParameters.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Surveyor Dimension Tool Example

Description

This example shows TODO.

Components

SurveyorDimension.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Text Along Curve Tool Example

Description

This example shows TODO.

Components

TextAlong.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


SDK Regen Tool Example

Description

This example shows TODO.

Components

ToolRegen.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Internet Palette Scripts Example

Description

This example shows TODO.

Components

HtmlScriptPack.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


Script Host Scripts Example

Description

This example shows TODO.

Components

WshScriptPack.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Events Example

Description

This example shows TODO.

Components

CPPEvents.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ LineType Example

Description

This example shows TODO.

Components

LTSample.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ MakeDwg Example

Description

This example shows TODO.

Components

MakeDwg.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ ActiveX Control Example

Description

This example shows TODO.

Components

OCXDemo.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ JPEG Filter Example

Description

This example shows TODO.

Components

JPEG.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Palette Example

Description

This example shows TODO.

Components

CustomPalette.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Rounded Rectangle 2 Regen Example

Description

This example shows TODO.

Components

CPPRRectA.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Rounded Rectangle Regen Example

Description

This example shows TODO.

Components

CPPRRect.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Spline Regen Example

Description

This example shows TODO.

Components

Spline.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Printing Server Example

Description

This example shows TODO.

Components

PrintCAD.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Server Example

Description

This example shows TODO.

Components

TCADEX.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Insert External Symbol Tool Example

Description

This example shows TODO.

Components

InsertExternalSymbol.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Insert Regen Object Tool Example

Description

This example shows TODO.

Components

InsertRegenObject.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Insert Symbol Tool Example

Description

This example shows TODO.

Components

InsertSymbol.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


C++ Wizard Example

Description

This example shows TODO.

Components

TCPssWiz.zip (Web link) Project archive.

Build Instructions

Download and unzip the archive.

More instructions


TurboCAD Object Reference

This section lists all the events, objects, methods and properties in the TurboCAD SDK.


BeforeDoubleClick Event

This event is triggered by TurboCAD before a double click action is taken.

Syntax

Sub object_BeforeDoubleClick(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Sel As Selection, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Sel Required Selection. The active Selection object.

Cancel Required Boolean. True to cancel the double click operation.


BeforeExit Event

This event is triggered by TurboCAD before the Application object quits.

Syntax

Sub object_BeforeExit(ByVal TheApp As Application, Cancel As Boolean)

TheApp Required Application. The Application object.

Cancel Required Boolean. Set to True to cancel the quit operation.


BeforeRightClick Event

This event is fired by TurboCAD before a right click action is taken.

Syntax

Sub object_BeforeRightClick(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Sel As Selection, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Sel Required Selection. The active Selection object.

Cancel Required Boolean. True to cancel the right click operation.


CommandBarControlDone Event

This event is fired by TurboCAD after the command has finished.

Remarks

The CommandBarControl object is not supported at this time (Version 8).

Syntax

Sub object_CommandBarControlDone(ByVal WhichControl As CommandBarControl)

WhichControl Required CommandBarControl. The CommandBarControl object.


CommandBarControlHit Event

This event is fired by TurboCAD when a CommandBarControl object was hit.

Remarks

The CommandBarControl object is not supported at this time (Version 8).

Syntax

Sub object_CommandBarControlHit(ByVal WhichControl As CommandBarControl, Cancel As Boolean)

WhichControl Required CommandBarControl. The CommandBarControl object.

Cancel Required Boolean. True to cancel the operation.


CommandBarControlStatus Event

This event is fired by TurboCAD to inquire on the status of a CommandBarControl object.

Remarks

The CommandBarControl object is not supported at this time (Version 8).

Syntax

Sub object_CommandBarControlStatus(ByVal WhichControl As CommandBarControl)

WhichControl Required CommandBarControl. The CommandBarControl object.


DrawingActivate Event

This event is triggered by TurboCAD after a Drawing object was activated.

Syntax

Sub object_DrawingActivate(ByVal WhichDrawing As Drawing)

WhichDrawing Required Drawing. The Drawing object that was activated.


DrawingAfterSave Event

This event is triggered by TurboCAD after a Drawing object has been saved.

Syntax

Sub object_DrawingAfterSave(ByVal WhichDrawing As Drawing)

WhichDrawing Required Drawing. The Drawing object that has been saved.


DrawingBeforeClose Event

This event is fired by TurboCAD before a Drawing object is closed.

Syntax

Sub object_DrawingBeforeClose(ByVal WhichDrawing As Drawing, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that will be closed.

Cancel Required Boolean. Set to True to cancel the close operation.


DrawingBeforeSave Event

This event is fired by TurboCAD before a Drawing object is saved.

Syntax

Sub object_DrawingBeforeSave(ByVal WhichDrawing As Drawing, SaveAs As Boolean, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that will be saved.

SaveAs Required Boolean. Set to True to save the Drawing object under a different name.

Cancel Required Boolean. Set to True to cancel the save operation.


DrawingDeactivate Event

This event is triggered by TurboCAD when a Drawing object will be deactivated.

Syntax

Sub object_DrawingDeactivate(ByVal WhichDrawing As Drawing)

WhichDrawing Required Drawing. The Drawing object that will be dactivated.


DrawingNew Event

This event is fired by TurboCAD after a new Drawing object is created.

Syntax

Sub object_DrawingNew(ByVal WhichDrawing As Drawing)

WhichDrawing Required Drawing. The Drawing object that was created.


DrawingOpen Event

This event fired by TurboCAD after an existing Drawing object is opened.

Syntax

Sub object_DrawingOpen(ByVal WhichDrawing As Drawing)

WhichDrawing Required Drawing. The Drawing object that was opened.


Drop Event

This event is fired by TurboCAD after something is dropped into a drawing.

Syntax

Sub object_Drop(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Sel As Selection)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Sel Required Selection. The active Selection object.


MouseDown Event

This event is fired by TurboCAD when a mouse button was pressed.

Syntax

Sub object_MouseDown(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Button As ImsiMouseButton, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Button Required ImsiMouseButton. Which button was pressed (0 - no button, 1 - left button, 2 - right button, 3 - wheel).

Shift Required Long. Which modifier keys were down when the action occurred.

X Required Long. The x window coordinate where the action occurred.

Y Required Long. The y window coordinate where the action occurred.

Cancel Required Boolean. True to cancel the mouse down operation.


MouseMove Event

This event is fired by TurboCAD when the mouse was moved.

Syntax

Sub object_MouseMove(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Shift Required Long. Which modifier keys were down when the action occurred.

X Required Long. The x window coordinate where the action occurred.

Y Required Long. The y window coordinate where the action occurred.

Cancel Required Boolean. True to cancel the move operation.


MouseUp Event

This event is fired by TurboCAD when a mouse button is released.

Syntax

Sub object_MouseUp(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Button As ImsiMouseButton, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Button Required ImsiMouseButton. Which button was releaseed (0 - no button, 1 - left button, 2 - right button, 3 - wheel).

Shift Required Long. Which modifier keys were down when the action occurred.

X Required Long. The x window coordinate where the action occurred.

Y Required Long. The y window coordinate where the action occurred.

Cancel Required Boolean. True to cancel the mouse up operation.


PointPick Event

Event fired by TurboCAD when a point pick operation hass completed or was canceled.

Syntax

Sub object_PointPick(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal Result As PickResult, ByVal PickWasCanceled As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

Result Required PickResult. The PickResult object describing what was picked.

PickWasCanceled Required Boolean. True if the pick operation was canceled by the user.


PointSnapped Event

This event is fired by TurboCAD when a point is picked in a View object.

Syntax

Sub object_PointSnapped(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal X As Long, ByVal Y As Long, ByVal PointRaw As Vertex, ByVal PointSnapped As Vertex)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

X Required Long. The x window coordinate where the action occurred.

Y Required Long. The y window coordinate where the action occurred.

PointRaw Required Vertex. A Vertex object that gives the location of the pick action.

PointSnapped Required Vertex. A Vertex object that gives the snapped location.


PolygonPick Event

This event is fired by TurboCAD when a polygon pick operation was completed or canceled.

Syntax

Sub object_PolygonPick(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal Result As PickResult, ByVal PickWasCanceled As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

Result Required PickResult. The PickResult object describing what was picked.

PickWasCanceled Required Boolean. True if the pick operation was canceled by the user.


RectanglePick Event

This event is fired by TurboCAD when a rectangle pick operation was completed or canceled.

Syntax

Sub object_RectanglePick(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal Result As PickResult, ByVal PickWasCanceled As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

Result Required PickResult. The PickResult object describing what was picked.

PickWasCanceled Required Boolean. True if the pick operation was canceled by the user.


RunTool Event

This event is fired by TurboCAD when a Tool object is activated.

Syntax

Sub object_RunTool(ByVal WhichTool As Tool)

WhichTool Required Tool. The Tool object that was activated.


SelectionChange Event

This event is fired by TurboCAD after the Selection object has changed.

Syntax

Sub object_SelectionChange(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window, ByVal Sel As Selection)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object in which the action occurred.

Sel Required Selection. The new active Selection object.


ViewAfterRedraw Event

This event is triggered by TurboCAD after a View object has been redrawn.

Syntax

Sub object_ViewAfterRedraw(ByVal WhichDrawing As Drawing, ByVal WhichView As View)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.


ViewBeforeRedraw Event

This event is fired by TurboCAD before a View object is redrawn.

Syntax

Sub object_ViewBeforeRedraw(ByVal WhichDrawing As Drawing, ByVal WhichView As View)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.


VirtualIntersectionPick Event

This event is fired by TurboCAD when a virtual intersection pick operation has been completed or canceled.

Syntax

Sub object_VirtualIntersectionPick(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal Result As PickResult, ByVal PickWasCanceled As Boolean)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

Result Required PickResult. The PickResult object describing what was picked.

PickWasCanceled Required Boolean. True if the pick operation was canceled by the user.


WindowActivate Event

This event is fired by TurboCAD when a Window object is activated.

Syntax

Sub object_WindowActivate(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object that was activated.


WindowDeactivate Event

This event is fired by TurboCAD before a Window object is deactivated.

Syntax

Sub object_WindowDeactivate(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object that will be deactivated.


WindowResize Event

This event is fired by TurboCAD when a Window object was resized.

Syntax

Sub object_WindowResize(ByVal WhichDrawing As Drawing, ByVal WhichView As View, ByVal WhichWindow As Window)

WhichDrawing Required Drawing. The Drawing object that owns the View object.

WhichView Required View. The View object in which the action occurred.

WhichWindow Required Window. The Window object that was resized.


Application Object

Represents the TurboCAD Application. The Application is the root object from which you initialize the TurboCAD engine. From this object you can create new drawings or open existing drawings, modify graphics, set object properties, etc.

Using the Application Object

The following example shows how to create an Application object and connect to the TurboCAD engine for inproc (DLL) server.

'Use IMSIGX.Application.4 for inproc (DLL) server
'Use TurboCAD.Application.4 for local (EXE) server
Dim TheApp As Object
Set TheApp = CreateObject("IMSIGX.Application.4")
If TheApp Is Nothing Then
   MsgBox "Could not start server.  " & Err.Description & "  Quitting."
End If


Block Object

Drawings collection (Drawing object)
Blocks collection (Block object)
Graphics collection (Graphic object)

A Block is a group of Graphic objects combined together into one object. You can use a Block object when, for example, you design a complex object with many parts and want to manipulate the object as a single entity (i.e. scale, rotate, delete). The primary advantage of using blocks is that you can easily update multiple instances of the same block of graphics in your drawing by simply updating the Block definition. You define the component once as a block and then insert instances of it as block references.

Using the Block Object

To access the Graphic hierarchy contained in a block:

Dim blk As Block
Dim grs as Graphics
Set blk = ActiveDrawing.Blocks("A_BLOCK_NAME")
Set grs = blk.Graphics

To create a Block and insert it into a drawing twice:

Dim grs As Graphics
Dim grGroup As Graphic
Dim blks As Blocks
Set grs = ActiveDrawing.Graphics
'Create a group to hold individual Graphics for the Block
  Set grGroup = grs.Add(imsiPolyline)
'Draw a nut (add Graphics to group)
  With grGroup.Graphics
    .AddLinePolygon 5, 5, 0, 6, 5, 0, 6
    .AddCircleCenterAndPoint 5, 5, 0, 5 + 1 * Sin(3.14159 / 3), 5, 0
    .AddCircleCenterAndPoint 5, 5, 0, 5 + 0.5, 5, 0
  End With
'Create block using the group
  Set blks = ActiveDrawing.Blocks
  blks.Add "NutBlock", grGroup, , , , False, False, False
'The group is now gone from the drawing
'Insert two blocks into drawing
  grs.AddBlockInsertion "NutBlock", 2, 7, 0
  grs.AddBlockInsertion "NutBlock", 7, 2, 0


Blocks Collection Object

Drawings collection (Drawing object)
Blocks collection (Block object)
Graphics collection (Graphic object)

The Blocks collection object is a library of blocks that are contained within a drawing. You use the Blocks collection object to access the individual blocks.

Using the Blocks Collection Object

To access a specific block by name from the blocks collection within a drawing:

Dim blk As Block
Set blk = ActiveDrawing.Blocks("A_BLOCK_NAME")


BoundingBox Object

A BoundingBox is an object that holds the minimum and maximum X, Y, and Z coordinates for an axis-aligned box in three dimensional space. BoundingBox objects are usually obtained by calling the CalcBoundingBox method on a Graphic object or from one of the collections of Graphic objects. The BoundingBox object returned is not owned by the Graphic, but is a copy of the current state of the Graphic. Since it is a copy, changing the minimum and maximum points on the BoundingBox will have no effect on the original Graphic.

Using the BoundingBox Object

The following example prints the BoundingBox coordinate information for a graphic to the Visual Basic for Applications Immediate Window. Min and Max are the Vertex objects contained in the bounding box.

Dim gr As Graphic
Dim bbox As BoundingBox
'Get the first graphic from the selection in the current drawing
Set gr = ActiveDrawing.Selection(0)
Set bbox = gr.CalcBoundingBox
Debug.Print "min: " & bbox.Min.X & ", " & bbox.Min.Y & ", " & bbox.Min.Z
Debug.Print "max: " & bbox.Max.X & ", " & bbox.Max.Y & ", " & bbox.Max.Z


BrushPattern Object

Drawings collection (Drawing object)
BrushStyles collection (BrushStyle object)
BrushPatterns collection (BrushPattern object)

Represents a brush pattern, which is made up of a collection of individual vector items. Each item consists of a starting position (X and Y coordinates in the pattern space), height and width, and a rotation angle. To specify new brush patterns contained in a brush style, you use the BrushPattern object.

Using the BrushPattern Object

SDK methods are currently not implemented.


BrushPatterns Collection Object

Drawings collection (Drawing object)
BrushStyles collection (BrushStyle object)
BrushPatterns collection (BrushPattern object)

The BrushPatterns collection object is a library of BrushPattern Objects that are contained within a drawing. You use the BrushPatterns collection object to access the individual BrushPattern Objects.

Using the BrushPatterns Collection Object

SDK methods are currently not implemented.


BrushStyle Object

Drawings collection (Drawing object)
BrushStyles collection (BrushStyle object)
BrushPatterns collection (BrushPattern object)
Graphics collection (Graphic object)

The BrushStyle object describes the different brush styles available in the Drawing or the brush styles used in a Graphic object.

Using the BrushStyle Object

For Each st In ActiveDrawing.BrushStyles
  Debug.Print "BrushStyle"
  Debug.Print " Name: " & st.Name
  Debug.Print " Type: " & st.Type
Next


BrushStyles Collection Object

Drawings collection (Drawing object)
BrushStyles collection (BrushStyle object)
BrushPatterns collection (BrushPattern object)

The BrushStyles Collection object is the collection of all the BrushStyle objects in the Drawing.

Using the BrushStyles Collection Object

To access all the available BrushStyle objects in the drawing:

For Each st In ActiveDrawing.BrushStyles ...


Camera Object

Drawings collection (Drawing object)
Views collection (View object)

The Camera Object allows you to control the direction of viewing. You can control where the camera is located, where it is pointed, and if it is rotated around its viewing axis. You access the Camera Object from the View Object.

Using the Camera Object

Accessing the Camera Object:

Dim TheView as View
Dim TheCamera as Camera
Set TheCamera = TheView.Camera


Drawing Object

Drawings collection (Drawing object)

Represents a TurboCAD drawing and is a member of the Drawings collection.

The Drawing object is a container for all the graphic and style data that is stored in a TurboCAD file. This data is organized in a series of collections that are read-only properties of the Drawing object.

Using the Drawing Object

To open an existing TurboCAD drawing and add it to the Drawings collection:

Dim dwg As Drawing
Set dwg = app.Drawings.Open("C:\Program Files\IMSI\TCWP70\Drawings\Drawing1.tcw")

To create a new TurboCAD drawing and add it to the Drawing collection:

Dim dwg As Drawing
Set dwg = app.Drawings.Add("MyNewDrawingName")


Drawings Collection Object

Drawings collection (Drawing object)

The Drawings collection object owns and maintains access to all the currently opened TurboCAD drawings.

Using the Drawings Collection Object

Use the Drawings collection to open an existing drawing:

Dim dwg As Drawing
Set dwg = Drawings.Open("C:\Program Files\Drawings\Drawing1.tcw")

To access the first drawing in the drawings collection and make it the active drawing (the drawing that has the focus):

app.Drawings(0).Activate

To close all the drawings open in TurboCAD:

'close all the drawings in the Application
app.Drawings.CloseAll


Filter Object

Filters collection (Filter object)

Represents a Filter (file converters which read and/or write a multitude of graphic file formats). The Filter object is a member of the Filters collection. The Filters collection contains all the Filter objects associated with the TurboCAD Application.

Using the Filter Object

This example shows how to iterate through all the Filters in the Filters Collection and display their extension (for example "dwg" for AutoCAD files) and description properties in the Visual Basic for Applications Immediate Window:

Dim flt As Filter
For Each flt In Application.Filters
  Debug.Print flt.Extension; ", " flt.Description
Next


Filters Collection Object

Filters collection (Filter object)

Represents the Filters Collection object. You use the collection to access the individual filter objects (file converters which read and/or write a multitude of graphic file formats) that are associated with the TurboCAD Application.

Using the Filters Collection Object

You access the Filters Collection object through the Application object:

Dim flt As Filter
For Each flt In Application.Filters
  ...
Next


Global Object

The Global object is used as a shortcut for many of the methods and properties of the Application object. If Visual Basic for Applications cannot find the name of a function, operator or statement in the list of its own built-in names, it will search for a matching property or method signature in the implied Global object.

Using the Global Object

For instance, to access the active drawing, the following two code statements are equivalent:

Dim app As Application
Dim dwg As Drawing
Set app = Application

'Using Application object's ActiveDrawing property
Set dwg = app.ActiveDrawing

'Using implied Global object's ActiveDrawing property
Set dwg = ActiveDrawing


Graphic Object

Drawings collection (Drawing object)
Graphics collection (Graphic object)

Represents a graphic. The Graphic object may be a member of the Graphics collection. The Graphics collection contains the Graphic objects in a drawing. The Graphic object can also be used to create standalone graphics (not part of any drawing).

Using the Graphic Object

The following example shows how to create a standalone graphic:

Dim gr As Graphic
'Create standalone graphic
Set gr = New Graphic

The following example shows how to create a graphic that is part of the Graphics collection and thus belongs to a drawing:

Dim gr As Graphic
'Create owned graphic
Set gr = ActiveDrawing.Graphics.Add


Graphics Collection Object

Drawings collection (Drawing object)
Graphics collection (Graphic object)

Represents a collection of graphics. The containers that take ownership of the Graphic objects within them are the Drawing object, the Block object, and the Graphic object (since Graphic objects are maintained in a hierarchy). Each of these objects exposes a Graphics Collection. These Graphics Collection objects have strict ownership (a Graphic may only belong to one collection at a time) over the individual Graphic objects within them.

Using the Graphics Collection Object

How to add a new graphic to the Graphics Collection owned by the drawing:

Dim gr As Graphic
'Create owned graphic
Set gr = ActiveDrawing.Graphics.Add

To count the number of graphics in a drawing and output this to the Visual Basic for Applications Immediate Window:

Debug.Print "Now " & ActiveDrawing.Graphics.Count & " graphics in drawing"

To access the Graphics collection in a block:

Dim blk As Block
Dim grs As Graphics
'Fetch a specific Block by name
Set blk = ActiveDrawing.Blocks("A_BLOCK_NAME")
'Access the Graphic collection of this Block
Set grs = blk.Graphics


GraphicSet Collection Object

Drawings collection (Drawing object)
GraphicSets collection (GraphicSet object)

Represents an arbitrary set of Graphics. Use the GraphicSet Collection object when you want a way to hold a set of references to Graphics in a particular drawing that are otherwise unrelated.

Using the GraphicSet Collection Object

To create a GraphicSet Collection Object:

Set gset = ActiveDrawing.GraphicSets.Add ("MyGraphicSet")

To add graphics to the GraphicSet:

Dim gr As Graphic
Set gr = ActiveDrawing.Graphics(0)
gset.AddGraphic gr


GraphicSets Collection Object

Drawings collection (Drawing object)
GraphicSets collection (GraphicSet object)

Represents a collection of GraphicSet objects and controls access to them.

Using the GraphicSets Collection Object

Create a GraphicSet Collection object and add it to the GraphicSets Collection:

Set gset = ActiveDrawing.GraphicSets.Add ("MyGraphicSet")


Layer Object

Drawings collection (Drawing object)
Layers collection (Layer object)

Use the Layer object in a drawing to organize (i.e. logically group) Graphic objects depending on their functionality, common uses, etc. Since the Layer object is a property of a Graphic, a Graphic can only be assigned to one Layer at a time.

Using the Layer Object

To add a Layer to a Drawing:

With ActiveDrawing.Layers
  .Add "Electrical"

To assign a Graphic to a Layer:

Dim gr As Graphic
'draw a circle
Set gr = ActiveDrawing.Graphics.AddCircle(0, 0, 0)
'assign it to the "Electrical" layer and assign it the layer's color
gr.Layer = "Electrical"


Layers Collection Object

Layers collection (Layer object)

Represents a collection of Layer objects.

Using the Layers Collection Object

The following example creates three new layers in an active drawing for our hypothetical building project and iterates all layers to the Visual Basic for Applications Immediate Window:

With ActiveDrawing.Layers
  .Add "Walls"
  .Add "Electrical"
  .Add "Piping"
Dim lyr As Layer
For Each lyr In ActiveDrawing.Layers
  Debug.Print lyr.Index & ": " & lyr.Name
Next


LineStyle Object

Drawings collection (Drawing object)
LineStyles collection (LineStyle object)
Graphics collection (Graphic object)

The LineStyle object is a member of the LineStyles collection. A new LineStyle object is added to the LineStyles collection object not the Graphic object. Each Graphic object uses one of the available LineStyles that already exist in the drawing.

Using the LineStyle Object

Iterate through all the Graphics in the active Drawing and print the properties of their LineStyles to the Visual Basic for Applications Immediate Window:

Dim gr As Graphic
Dim dashes As Variant
Dim st As LineStyle
Dim j As Long

For Each gr In ActiveDrawing.Selection
  DebugPrint "Graphic -- " & gr.Type
  st = gr.LineStyle

  Debug.Print "LineStyle"
  Debug.Print " Name: " & st.Name
  Debug.Print " Description: " & st.Description

  Debug.Print " Dashes"
  st.GetDashes dashes
  For j = LBound(dashes) To UBound(dashes)
     Debug.Print " (" & j & ") " & dashes(j)
  Next j
Next


LineStyles Collection Object

Drawings collection (Drawing object)
LineStyles collection (LineStyle object)

Each Drawing contains a LineStyles collection that contains specifications for line drawing patterns.

Using the LineStyles Collection Object

You access the LineStyle collection off of the drawing object:

Dim st As IMSIGX.LineStyle
For Each st In ActiveDrawing.LineStyles


Macro Object

Drawings collection (Drawing object)
Macros collection (Macro object)

Represents a VBA Macro object. A Macro holds information about Visual Basic for Application projects that are associated with a drawing. To access a Macro object associated with the active drawing, you use the Macros collection object.

Using the Macro Object

List all the VBA projects associated with a drawing to the Visual Basic for Applications Immediate Window:

Dim mac As Macro
   For Each mac In ActiveDrawing.Macros
   Debug.Print "Macro " & mac.Name & ", contained in " & mac.Path
Next


Macros Collection Object

Drawings collection (Drawing object)
Macros collection (Macro object)

Represents a Macros collection object. You gain access to the Macros Collection through the active drawing.

Using the Macros Collection Object

List all the VBA projects associated with a drawing:

Dim mac As Macro
   For Each mac In ActiveDrawing.Macros
   Debug.Print "Macro " & mac.Name & ", contained in " & mac.Path
Next


Matrix Object

Represents a Matrix object. The Matrix object is a 4x4 matrix defined in row-major order. You can use the SetEntries method to load the Matrix with a list of 16 values, or the SetArray method to load the Matrix elements from a one-dimensional Visual Basic array of 16 values, or a two-dimensional 4x4 Visual Basic array. The Matrix operates on the three dimensional coordinate system, so the fourth column of values are ignored.

Using the Matrix Object

  Dim gr0 As Graphic
  Dim gr As Graphic
  Dim mtx As Matrix
  Set mtx = New Matrix

  'Set up a pure translation matrix
  'Translation (5, 6, 7)

  mtx.SetEntries _
    1, 0, 0, 0, _
    0, 1, 0, 0, _
    0, 0, 0, 0, _
    5, 6, 7, 1

  Set gr0 = ActiveDrawing.Graphics(0)
  Set gr = gr0.Duplicate
  gr.Transform mtx


NamedColor Object

NamedColors collection (NamedColor object)

Represents a NamedColor object. TurboCAD uses an internal list of human-readable color names, such as "red" or "green", to display colors in its user interface. Use this object when you want to work with color names instead of RGB values.

Using the NamedColor Object

Here is a function that finds the closest NamedColor Object to a given RGB (long) value and prints it to the Visual Basic for Applications Immediate Window:

Function FindNamedColor(ByVal clr As Long, maxDist As Long) As
    IMSIGX.NamedColor
    On Error Resume Next
    Dim nclr, best As IMSIGX.NamedColor
    Dim tr, tg, tb As Long
    Dim dr, dg, db, i As Long

    Set best = Nothing
    tr = clr Mod 256&
    tg = (clr \ 256&) Mod 256&
    tb = (clr \ (256& * 256&)) Mod 256&
    Debug.Print Application.NamedColors.Count; " named colors"
    i = 0
    For Each nclr In Application.NamedColors
       clr = nclr.Color
       If clr >= 0 Then
          dr = clr Mod 256&
          dg = (clr \ 256&) Mod 256&
          db = (clr \ (256& * 256&)) Mod 256&
          dr = tr - dr

          If dr < 0 Then dr = -dr
          dg = tg - dg
          If dg < 0 Then dg = -dg
          db = tb - db
          If db < 0 Then db = -db

          Debug.Print "(" & i & ") " & nclr.Name & " " & dr & " " & dg & " " & db
          If dr < maxDist And dg < maxDist And db < maxDist Then
             If dr < dg Then
                maxDist = dr
             Else
                maxDist = dg
             End If
             If db < maxDist Then
                maxDist = db
             End If
             Set best = nclr
             If maxDist = 0 Then Exit For
          End If
       End If
       i = i + 1
    Next
    Set FindNamedColor = best
End Function


NamedColors Collection Object

NamedColors collection (NamedColor object)

Represents the NamedColors Collection object. You use the NamedColors collection to access the individual NamedColor objects.

Using the NamedColors Collection Object

Here is how you use the NamedColors Collection object to change the color of a graphic:

Dim grModified As Graphic
Set grModified = ActiveDrawing.Graphics(0)
grModified.Properties("PenColor") = NamedColors("Blue")


NamedView Object

Drawings collection (Drawing object)
NamedViews collection (NamedView object)

Create NamedView objects to store frequently used camera and zoom factor positions. The NamedView object is part of the NamedViews Collection and is associated with a particular Drawing.

Using the NamedView Object

To change your view to an already created NamedView object:

Dim nvw As NamedView
Set nvw = ActiveDrawing.NamedViews("View_0")
ActiveDrawing.ActiveView.ZoomToNamedView(nvw)

To create a new NamedView object:

With ActiveDrawing.ActiveView
  Set nvw = ActiveDrawing.NamedViews.Add("SaveMe", _ .ViewLeft, .ViewTop, .ViewWidth,
  .ViewHeight, .Camera)
End With


NamedViews Collection Object

Drawings collection (Drawing object)
NamedViews collection (NamedView object)

NamedView Collection object holds all the created NameView objects (saved camera and zoom factor positions).

Using the NamedViews Collection Object

Create a new NamedView object by adding it to the NamedViews collection object:

With ActiveDrawing.ActiveView
  Set nvw = ActiveDrawing.NamedViews.Add("SaveMe", _ .ViewLeft, .ViewTop, .ViewWidth,
  .ViewHeight, .Camera)
End With


PageSetup Object

Drawings collection (Drawing object)

The PageSetup Object is used to control the Drawing Object's active PaperSpace object (margins, sheet size, etc.).

Using the PageSetup Object

To read PageSetup properties:

Dim PSetUp As PageSetup
Dim PaperWidth#, PaperHeight#

'Read paper size properties
Set PSetUp = ActDr.PageSetup
PaperWidth = PSetUp.SheetWidth
PaperHeight = PSetUp.SheetHeight


PaperSpace Object

Drawings collection (Drawing object)
PaperSpaces collection (PaperSpace object)
Graphics collection (Graphic object)
Properties collection (Property object)

The PaperSpace object is used to control the view's screen and view coordinates. It's primary purpose is to create a layout for printing drawings, but is also used to layout various views of the drawing using viewports. Note: PaperSpace is exclusively a two-dimensional environment. Changing the camera position has no effect in paper space mode.

Using the PaperSpace Object

To see which space mode you are currently working in you need to access the View object:

Dim gxVw As View
Set gxVw = ActiveDrawing.ActiveView

To add a new PaperSpace object you use the PaperSpace Collection:

Dim ps As PaperSpace
Set ps = ActiveDrawing.PaperSpaces.Add("NewLayout")


PaperSpaces Collection Object

Drawings collection (Drawing object)
PaperSpaces collection (PaperSpace object)
Graphics collection (Graphic object)
Properties collection (Property object)

The Drawing object's PaperSpaces collection manages the layouts for a drawing.

Using the PaperSpaces Collection Object

You can create a new layout by using the PaperSpace collection's Add method:

Dim ps As PaperSpace
Set ps = ActiveDrawing.PaperSpaces.Add("NewLayout")


PickEntry Object

Drawings collection (Drawing object)
Views collection (View object)

The PickEntry object gives information about the graphic picked and is a member of the PickResult collection. The PickEntry object can be thought of as a collection that references a single Graphic object, but does not own it.

Using the PickEntry Object

Access the PickEntry object using the PickResult object to see if Graphic picked has the type "CIRCLE":

Dim pres As PickResult
Dim pent As PickEntry
Set pres = ActiveDrawing.ActiveView.PickPoint(xClick, yClick)

pent = pres.item(0)
If pent.Graphic.Type = "CIRCLE" Then
  .Select
Else
  .Unselect
End If


PickResult Collection Object

Drawings collection (Drawing object)
Views collection (View object)

Use the View object's PickResult collection to find out what Graphic entities are located in the area of the specified point in the TurboCAD Drawing.

Using the PickResult Collection Object

Get the mouse click coordinates and see how many graphics are included in the PickResult:

Dim Vi As View
Dim ActDr As Drawing
Dim PRes As PickResult
Dim PicCount As Long
Dim xClick#, yClick#

Set ActDr = ActiveDrawing
Set Vi = ActDr.Views(0)
Vi.GetMouseClick xClick, yClick Set
PRes = Vi.PickPoint(xClick, yClick)
PiCount = PRes.Count


Property Object

Properties collection (Property object)

The Property object is used to investigate custom or extended properties of objects. The Property object is part of the Properties collection. Custom and extended Property objects have Name, Type, and Value as standard properties exposed.

Using the Property Object

Iterate through the ActiveDrawing Properties:

Dim props As Properties
Dim i, count As Integer
Dim prop As Property

props = ActiveDrawing.Properties
count = props.count
Debug.Print " " & count & " Properties:"
For i = 0 To count - 1
  Set prop = props(i)
  Debug.Print " Name " & prop.Name
Next


Properties Collection Object

Properties collection (Property object)

The objects contained in the Properties collection are Property objects. Each extended or custom Property object has a Name, Type, and Value standard property exposed. You can query both extended and custom properties for these.

Using the Properties Collection Object

Get the Properties collection of the Active Drawing:

props = ActiveDrawing.Properties


RegenMethod Object

RegenMethods collection (RegenMethod object)

A RegenMethod Object is a process packaged in a DLL located in TurboCAD's Regens directory that is responsible for maintaining the properties of a graphic object subtype.

You can write RegenMethod DLLs using the SDK with an external development system (see the Advanced Projects section for more information on writing your own RegenMethod DLL).

Using the RegenMethod Object

The following example prints all RegenMethods and their description to the Immediate Window:

Dim rm As RegenMethod
For Each rm In Application.RegenMethods
   Debug.Print rm.Name
   Debug.Print rm.Description
Next


RegenMethods Collection Object

RegenMethods collection (RegenMethod object)

The Application object's RegenMethods Collection is the collection of all currently registered external objects, both built-in (shipped with the TurboCAD program) and user-designed objects.

Using the RegenMethods Collection Object

The following example prints all RegenMethods to the Immediate Window:

Dim rm As RegenMethod
For Each rm In Application.RegenMethods
   Debug.Print rm.Name
Next


Render Object

Renders collection (Render object)

Each Render object represents a particular 3D rendering system. TurboCAD ships with the industry standard OpenGL rendering system, a native hidden line renderer, and a high-quality raytracing and radiosity system licensed from Lightwork Design, Ltd. The properties of the Render object allow you to query the capabilities of the particular rendering system, and to set up the defaults for new rendering jobs.

Using the Render Object

Once you have set the rendering mode and quality you can get a bitmap rendering from any view by calling the Render object's only method, Run:

Dim vw As View
Dim rnd As Render
Dim opic As IPicture

'Set up the camera
Set vw = ActiveDrawing.ActiveView vw.Camera.Perspective = True

'Set up the rendering type
Set rnd = Application.Renders("OpenGL")
rnd.DefaultMode = imsiRenderModeGouraud

'Run the rendering process
Set opic = rnd.RunPicture(vw)

Note: Currently the run method does not return an IPicture object (it does start the rendering). You can also start rendering by using the RenderView.BeginRender method.


Renders Collection Object

Renders collection (Render object)

The Application object's Renders Collection Object allows you to find out the available rendering capabilities and set up preferences for 3D rendering.

Using the Renders Collection

You can enumerate all the possible rendering modes with the following example:

Dim i, j, rcount As Long
Dim rnd As Render
Dim rmodes As Variant
With Application.Renders
   rcount = .count
   For i = 0 To rcount - 1
     Set rnd = .Item(i)
     Debug.Print "Render: " & rnd.Name
     rmodes = rnd.modes
     If VarType(rmodes) <> vbEmpty Then
        For j = 0 To UBound(rmodes)
           Debug.Print " Mode: " & rmodes(j)
        Next
     Else
        Debug.Print " No modes"
     End If
     rmodes = rnd.RadExtendedModes
     If VarType(rmodes) <> vbEmpty Then
        For j = 0 To UBound(rmodes)
           Debug.Print " Radiosity mode: " & rmodes(j)
        Next
     Else
        Debug.Print " No radiosity modes"
     End If
   Next
End With


RenderView Object

Drawings collection (Drawing object)
Views collection (View object)

The RenderView Object gives you control over the 3D rendering process. To control the 3D rendering characteristics, you set the properties of the RenderView Object.

There are 2 ways to start rendering threw the SDK: RenderView.BeginRender and Render.Run There is one way to stop rendering: RenderView.EndRender. It is necessary to use the RenderView.DoRender method if rendering starts in TurboCAD's window otherwise it should be called in the "Paint" message handler for the corresponding window.

Using the RenderView Object

This example shows how to access the RenderView Object:

Dim gxVw As View
Dim gxRVw As RenderView

Set gxVw = ActiveDrawing.ActiveView
If (gxVw.SpaceMode = imsiModelSpace) Then
   Set gxRVw = gxVw.RenderView
   ...
Else
   MsgBox "Not available for Paper Space view"
End If


Selection Object

Drawings collection (Drawing object)

The Drawing object's Selection Object is a non-owning sub-collection of top-level Graphics in a drawing that are the result of a selection in the user interface. Graphic objects move into and out of this collection as the user performs selection operations. A common technique for Visual Basic for Application macros is to prompt for a selection operation, and then act on the contents of the Selection Object.

Using the Selection Object

To access the current graphics that are selected:

For Each gr In ActiveDrawing.Selection

To add graphics to the Selection Object (3 ways):

If ActiveDrawing.Graphics.Count > 0 Then
   ActiveDrawing.Graphics(0).Select
End If
ActiveDrawing.SelectAll
ActiveDrawing.Graphics.Select


Tie Object

Drawings collection (Drawing object)
TieSets collection (TieSet object)
Ties collection (Tie object)

A Tie Object is a single subject-subordinate relationship between specific parts of the two graphics. In addition to specifying the two graphics involved in the association, Tie Objects have a Priority property that establishes a ranking in case of conflict, and a Data property that holds the data that maintains the geometrical state of the Tie as the subordinate and subject Graphics change.

Using the Tie Object

Please refer to our advance topics, Creating Custom Ties , and our VB Tie example, VertexTies, for more information on how to use this object.


TieMethod Object

TieMethods collection (TieMethod object)

For each installed tie object server, TurboCAD creates a corresponding TieMethod Object that is added to the Application object's TieMethods collection.

Using the TieMethod Object

Please refer to our advance topics, Creating Custom Ties , and our VB Tie example, VertexTies, for more information on how to use this object.


TieMethods Collection Object

TieMethods collection (TieMethod object)

TieMethods Collection Object is a collection of TieMethod Objects for the different tie servers available to the TurboCAD Application Object.

Using the TieMethods Collection Object

Please refer to our advance topics, Creating Custom Ties , and our VB Tie example, VertexTies, for more information on how to use this object.


TieSet Object

Drawings collection (Drawing object)
TieSets collection (TieSet object)
Ties collection (Tie object)

The TieSet Object represents a group of related associations between a single pair of Graphic objects: the "subject" graphic and the "subordinate" graphic.

Using the TieSet Object

Please refer to our advance topics, Creating Custom Ties , and our VB Tie example, VertexTies, for more information on how to use this object.


TieSets Collection Object

Drawings collection (Drawing object)
TieSets collection (TieSet object)
Ties collection (Tie object)

A TieSets Collection Object represents all the associations between graphics contained within the Drawing. The Tie and TieSet associations are usually created by a custom tool, whose job it is to identify the subject and subordinate Graphic objects.

Using the TieSets Collection Object

Please refer to our advance topics, Creating Custom Ties , and our VB Tie example, VertexTies, for more information on how to use this object.


Tool Object

Tools collection (Tool object)

A Tool Object is a process contained in a DLL in TurboCAD's Tools directory that can be integrated into the TurboCAD user interface.

Using the Tool Object

To display the name of each tool in the VBA Immediate Window:

Dim t As Tool
For Each t In Application.Tools
   Debug.Print t.CommandName
Next


Tools Collection Object

Tools collection (Tool object)

Use the Tools Collection Object to access the different Tool Objects available in the TurboCAD Application.

Using the Tools Collection Object

This example shows how to run any tool from the SDK by using the Tool object's Activate method:

Application.Tools("someName").Activate


UndoRecord Object

Drawings collection (Drawing object)

For each Graphic object that is created, destroyed or modified as part of an undoable action, you must add a reference to the graphic to the UndoRecord Object that you have set up. The UndoRecord Object exposes a method for each of the three actions: create, destroy and modify.

Using the UndoRecord Object

First you must create an UndoRecord Object:

Dim urec As UndoRecord
Set urec = ActiveDrawing.AddUndoRecord("Add Part")

To add a graphic to the UndoRecord Object:

Dim grNew As Graphic
Set grNew = ActiveDrawing.AddSquare
urec.AddGraphic grNew

If you modify a graphic you need to update the UndoRecord Object:

Dim grModified As Graphic
Set grModified = ActiveDrawing.Graphics(0)
grModified.Properties("PenColor") = NamedColors("Blue")
grModified.Vertices(0).X = 3
urec.AddGraphicForModify grModified


Vertex Object

Drawings collection (Drawing object)
Graphics collection (Graphic object)
Vertices collection (Vertex object)

Represents a vertex. The Vertex object is a member of the Vertices collection. The Vertices collection contains all the Vertex objects in a graphic.

The Vertex object can also be used outside of the Vertices collection to hold three dimensional coordinate information. For example, the three dimensional size of graphic objects is returned in a BoundingBox object, which contains two Vertex objects that hold the minimum and maximum coordinates of the object.

Using the Vertex Object

Use Vertices(index), where index is the vertex index number, to return a single Vertex object. The following example determines whether the first vertex in a graphic can be edited using the user interface.

Dim gr As Graphic
Dim editable As Boolean
Set gr = ActiveDrawing.Selection(0)
editable = gr.Vertices(0).Editable

The following example prints the bounding box coordintate information for a graphic to the Visual Basic for Applications Immediate Window. Min and Max are the Vertex objects contained in the bounding box.

Dim gr As Graphic
Dim bbox As BoundingBox
Set gr = ActiveDrawing.Selection(0)
Set bbox = gr.CalcBoundingBox
Debug.Print "min: " & bbox.Min.X & ", " & bbox.Min.Y & ", " & bbox.Min.Z
Debug.Print "max: " & bbox.Max.X & ", " & bbox.Max.Y & ", " & bbox.Max.Z


Vertices Collection Object

Drawings collection (Drawing object)
Graphics collection (Graphic object)
Vertices collection (Vertex object)

The Vertices Collection Object gives you access to the Vertex objects within a Graphic.

Using the Vertices Collection Object

To access a Vertex that is part of a Graphic's Vertices Collection, you use standard methods for collections:

Dim gr As Graphic
Dim vtx As Vertex
Set gr = ActiveDrawing.Graphics(0)
Set vtx = gr.Vertices(0)


View Object

Drawings collection (Drawing object)
Views collection (View object)

Use the View Object to display portions of a TurboCAD Drawing in a region of a window, to print a drawing, or to control the rendering of an object. By modifying a View Object's properties, you can control the position and zoom of the view, and whether the View is in paper space or model space. You can perform projection transformations to convert from 2D or 3D world coordinates to 2D screen coordinates and vice versa. You can also use the View Object to find out what Graphic entities are located in the vicinity of a specified point or area in a TurboCAD drawing use the View Object's PickResult collection. Typically the PickResult collection is used to analyze Graphic objects at the point of mouse click.

Using the View Object

Here's how to change from orthographic projection to perspective projection:

Dim acView As View
Set acView = ActiveDrawing.ActiveView
If (acView.SpaceMode = imsiModelSpace) Then
  If (acView.Camera.Perspective) Then
    acView.Camera.Perspective = False
  Else
    acView.Camera.Perspective = True
  End If
End
If Set acView = Nothing

Here's how to change the camera projection for perspective:

Dim acView As View
Set acView = ActiveDrawing.ActiveView
If (acView.SpaceMode = imsiModelSpace) Then
   acView.Camera.Perspective = True
   acView.Camera.PerspectiveAngle = 0.5
End If
Set acView = Nothing


Views Collection Object

Drawings collection (Drawing object)
Views collection (View object)

The Views collection object is a library of views that are contained within a drawing. You use the Views collection object to access the individual views.

Using the Views Collection Object

When you open a new drawing project in TurboCAD a default View is automatically created, i.e. the Views collection of a TurboCAD drawing is not empty. You access a View object in your VBA project through the Views collection of a Drawing object:

Dim vw As IMSIGX.View
Set vw = ActiveDrawing.Views(0)

If you want your new View to draw onto an existing Windows device context, you supply the handle (hDC property) of the device context in the call to Views.Add:

Dim hDC As Long
'Get hDC value from somewhere
Dim vw As View
Set vw = ActiveDrawing.Views.Add(, hDC)


Activate Method

Activates the object.

Syntax 1

expression.Activate

expression Required. An expression that returns a Drawing object.

Syntax 2

expression.Activate

expression Required. An expression that returns a PaperSpace object.

Syntax 3

expression.Activate

expression Required. An expression that returns a Tool object.


Add Method

Creates and adds a new object to the collection.

Syntax 1

expression.Add(Name, Graphic, XRef, YRef, ZRef, CopyGraphic, InsertBlock, Insert)

expression Required. An expression that returns a Blocks object.

Name Required String. The name of the new Block object.

Graphic Required Graphic. The Graphic object that the Block object will contain.

XRef Required Variant. X coordinate of the block reference point.

YRef Optional Variant. Y coordinate of the block reference point.

ZRef Optional Variant. Z coordinate of the block reference point.

CopyGraphic Optional Variant. True to make the block using copies of the Graphic object.

InsertBlock Optional Variant. True to insert the new block in the Drawing object.

Insert Optional Variant. The Insert Graphic object if InsertBlock was true

Return Value

Block. The newly created Block object.

Syntax 2

expression.Add(Template)

expression Required. An expression that returns a Drawings object.

Template Required Variant. A drawing template name.

Return Value

Drawing. The newly created Drawing object.

Syntax 3

expression.Add(Name, Temporary)

expression Required. An expression that returns a GraphicSets object.

Name Required Variant. The name of the GraphicSet object.

Temporary Optional Variant. True if the new GraphicSet object deletes on release.

Return Value

GraphicSet. The new GraphicSet object.

Syntax 4

expression.Add(GraphicType, RegenMethod, Inherit, Style, Before, After)

expression Required. An expression that returns a Layer object.

GraphicType Required Variant. The type of the Graphic object.

RegenMethod Optional Variant. A RegenMethod object or index.

Inherit Optional Variant. True if the new Graphic object will inherit the properties of its parent.

Style Optional Variant. Not used in current implementation.

Before Optional Variant. The Graphic object or index that will follow the added Graphic object.

After Optional Variant. The Graphic object or index that will precede the added Graphic object.

Return Value

Graphic. The newly created Graphic object.

Syntax 5

expression.Add(Name, Visible, Editable, Frozen, Color, LineStyle, BrushStyle, GraphicStyle, ZOrder)

expression Required. An expression that returns a Layers object.

Name Required String. The name of the Layer object.

Visible Required Variant. True if Graphic objects on the Layer object are visible.

Editable Optional Variant. True if Graphic objects on the Layer object can be edited.

Frozen Optional Variant. True if Graphic objects on the Layer object cannot be edited or selected.

Color Optional Variant. The color of the Layer object.

LineStyle Optional Variant. The LineStyle object name or object for the Layer object.

BrushStyle Optional Variant. The BrushStyle object name or object for the Layer object.

GraphicStyle Optional Variant. The Style object name or object for the Layer object.

ZOrder Optional Variant. The z order for the Layer object.

Return Value

Layer. The newly created Layer object.

Syntax 6

expression.Add(Name, Dashes, Description)

expression Required. An expression that returns a LineStyles object.

Name Required String. The name of the LineStyle object.

Dashes Required Variant. An array of dash lengths.

Description Required Variant. A description string.

Return Value

LineStyle. The newly created LineStyle object.

Syntax 7

expression.Add(Name, Path)

expression Required. An expression that returns a Macros object.

Name Required String. The name of the new Macro object.

Path Required String. Description missing

Return Value

Macro. The newly created Macro object.

Syntax 8

expression.Add(Name, Color)

expression Required. An expression that returns a NamedColors object.

Name Required String. The name of the NamedColor object.

Color Required Long. The RGB value of the NamedColor object.

Return Value

NamedColor. The newly created NamedColor object.

Syntax 9

expression.Add(Name, XMin, YMin, XMax, YMax)

expression Required. An expression that returns a NamedViews object.

Name Required String. The name of the new NamedView object.

XMin Required Double. The x coordinate of one corner (in viewport coordinates).

YMin Required Double. The y coordinate of one corner (in viewport coordinates).

XMax Required Double. The x coordinate of the other corner (in viewport coordinates).

YMax Required Double. The y coordinate of the other corner (in viewport coordinates).

Return Value

NamedView. The newly created NamedView object.

Syntax 10

expression.Add(Name, Value, ReadOnly, ID)

expression Required. An expression that returns a Properties object.

Name Required String. Name of the new Property object.

Value Required Variant. The value of the new Property object, by reference.

ReadOnly Optional Variant. True if the new Property object's value cannot be modified.

ID Optional Variant. Internal ID.

Return Value

Property. The newly created Property object.

Syntax 11

expression.Add(X, Y, Z, PenDown, Selectable, Snappable, Editable, Linkable, Calculated, Before, After)

expression Required. An expression that returns a Vertices object.

X Required Variant. X coordinate of the vertex.

Y Optional Variant. Y coordinate of the vertex.

Z Optional Variant. Z coordinate of the vertex.

PenDown Optional Variant. True if the segment to this vertex is drawn.

Selectable Optional Variant. True if the vertex can be selected.

Snappable Optional Variant. True if the vertex can be snapped to.

Editable Optional Variant. True if the vertex can be edited.

Linkable Optional Variant. True if the vertex can be linked to.

Calculated Optional Variant. True if the Vertex object is recalculated by the RegenMethod.

Before Optional Variant. Vertex object or index to follow this one.

After Optional Variant. Vertex object or index to precede this one.

Return Value

Vertex. The newly created Vertex object.

Syntax 12

expression.Add(HWND, hDC)

expression Required. An expression that returns a Views object.

HWND Required Variant. A window handle to attach to the View object.

hDC Optional Variant. A DC to attach to the View object.

Return Value

View. The newly created View object.


AddArcCenterAndPoint Method

Creates and adds an arc to the collection.

Syntax 1

expression.AddArcCenterAndPoint(X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of arc's center point.

Y0 Required Double. Y coordinate of arc's center point.

Z0 Required Double. Z coordinate of arc's center point.

X1 Required Double. X coordinate of arc's radius point.

Y1 Required Double. Y coordinate of arc's radius point.

Z1 Required Double. Z coordinate of arc's radius point.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddArcCenterAndPoint(X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of arc's center point.

Y0 Required Double. Y coordinate of arc's center point.

Z0 Required Double. Z coordinate of arc's center point.

X1 Required Double. X coordinate of arc's radius point.

Y1 Required Double. Y coordinate of arc's radius point.

Z1 Required Double. Z coordinate of arc's radius point.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.


AddArcDoublePoint Method

Creates and adds an arc to the collection.

Syntax 1

expression.AddArcDoublePoint(X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of first endpoint.

Y0 Required Double. Y coordinate of first endpoint.

Z0 Required Double. Z coordinate of first endpoint.

X1 Required Double. X coordinate of second endpoint.

Y1 Required Double. Y coordinate of second endpont.

Z1 Required Double. Z coordinate of second endpoint.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddArcDoublePoint(X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of first endpoint.

Y0 Required Double. Y coordinate of first endpoint.

Z0 Required Double. Z coordinate of first endpoint.

X1 Required Double. X coordinate of second endpoint.

Y1 Required Double. Y coordinate of second endpont.

Z1 Required Double. Z coordinate of second endpoint.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.


AddArcElliptical Method

Creates and adds an elliptical arc to the collection.

Syntax 1

expression.AddArcElliptical(X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of bounding rectangle's upper left corner.

Y0 Required Double. Y coordinate of bounding rectangle's upper left corner.

Z0 Required Double. Z coordinate of bounding rectangle's upper left corner.

X1 Required Double. X coordinate of bounding rectangle's lower right corner.

Y1 Required Double. Y coordinate of bounding rectangle's lower right corner.

Z1 Required Double. Z coordinate of bounding rectangle's lower right corner.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddArcElliptical(X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of bounding rectangle's upper left corner.

Y0 Required Double. Y coordinate of bounding rectangle's upper left corner.

Z0 Required Double. Z coordinate of bounding rectangle's upper left corner.

X1 Required Double. X coordinate of bounding rectangle's lower right corner.

Y1 Required Double. Y coordinate of bounding rectangle's lower right corner.

Z1 Required Double. Z coordinate of bounding rectangle's lower right corner.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.


AddArcEllipticalFixedRatio Method

Creates and adds an elliptical arc to the collection.

Syntax 1

expression.AddArcEllipticalFixedRatio(X0, Y0, Z0, X1, Y1, Z1, XToYRatio, StartAngle, EndAngle)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of ellipse's center point.

Y0 Required Double. Y coordinate of ellipse's center point.

Z0 Required Double. Z coordinate of ellipse's center point.

X1 Required Double. X coordinate of radius in Y direction.

Y1 Required Double. Y coordinate of radius in Y direction.

Z1 Required Double. Z coordinate of radius in Y direction.

XToYRatio Required Double. Ratio of Rx to Ry.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddArcEllipticalFixedRatio(X0, Y0, Z0, X1, Y1, Z1, XToYRatio, StartAngle, EndAngle)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of ellipse's center point.

Y0 Required Double. Y coordinate of ellipse's center point.

Z0 Required Double. Z coordinate of ellipse's center point.

X1 Required Double. X coordinate of radius in Y direction.

Y1 Required Double. Y coordinate of radius in Y direction.

Z1 Required Double. Z coordinate of radius in Y direction.

XToYRatio Required Double. Ratio of Rx to Ry.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.


AddArcRotatedElliptical Method

Creates and adds an elliptical arc to the collection.

Syntax 1

expression.AddArcRotatedElliptical(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2, StartAngle, EndAngle)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of elliptical arc's center point.

Y0 Required Double. Y coordinate of elliptical arc's center point.

Z0 Required Double. Z coordinate of elliptical arc's center point.

X1 Required Double. X coordinate of major axis radius point.

Y1 Required Double. Y coordinate of major axis radius point.

Z1 Required Double. Z coordinate of major axis radius point.

X2 Required Double. X coordinate of minor axis radius point.

Y2 Required Double. Y coordinate of minor axis radius point.

Z2 Required Double. Z coordinate of minor axis radius point.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddArcRotatedElliptical(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2, StartAngle, EndAngle)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of elliptical arc's center point.

Y0 Required Double. Y coordinate of elliptical arc's center point.

Z0 Required Double. Z coordinate of elliptical arc's center point.

X1 Required Double. X coordinate of major axis radius point.

Y1 Required Double. Y coordinate of major axis radius point.

Z1 Required Double. Z coordinate of major axis radius point.

X2 Required Double. X coordinate of minor axis radius point.

Y2 Required Double. Y coordinate of minor axis radius point.

Z2 Required Double. Z coordinate of minor axis radius point.

StartAngle Required Double. Starting angle in radians.

EndAngle Required Double. Ending angle in radians.

Return Value

Graphic. The newly created Graphic object.


AddArcTriplePoint Method

Creates and adds an arc to the collection.

Syntax 1

expression.AddArcTriplePoint(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of starting point.

Y0 Required Double. Y coordinate of starting point.

Z0 Required Double. Z coordinate of starting point.

X1 Required Double. X coordinate of point on perimeter.

Y1 Required Double. Y coordinate of point on perimeter.

Z1 Required Double. Z coordinate of point on perimeter.

X2 Required Double. X coordinate of ending point.

Y2 Required Double. Y coordinate of ending point.

Z2 Required Double. Z coordinate of ending point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddArcTriplePoint(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of starting point.

Y0 Required Double. Y coordinate of starting point.

Z0 Required Double. Z coordinate of starting point.

X1 Required Double. X coordinate of point on perimeter.

Y1 Required Double. Y coordinate of point on perimeter.

Z1 Required Double. Z coordinate of point on perimeter.

X2 Required Double. X coordinate of ending point.

Y2 Required Double. Y coordinate of ending point.

Z2 Required Double. Z coordinate of ending point.

Return Value

Graphic. The newly created Graphic object.


AddAttributeDefinition Method

Creates and adds an attribute definition Graphic object to the collection.

Syntax 1

expression.AddAttributeDefinition(Tag, X0, Y0, Z0, Height, Angle, Width, Offset, Justification, AttFlags, Default, Prompt)

expression Required. An expression that returns a Block object.

Tag Required String. The text string for the attribute definition tag.

X0 Required Double. X coordinate of attdef's starting point.

Y0 Required Double. Y coordinate of attdef's starting point.

Z0 Required Double. Z coordinate of attdef's starting point.

Height Required Double. Height of attdef object.

Angle Required Variant. Rotation angle of attdef in radians.

Width Optional Variant. Width of attdef object.

Offset Optional Variant. An ImsiTextOffset.

Justification Optional Variant. An ImsiTextJustification.

AttFlags Optional Variant. ImsiAttFlag values.

Default Optional Variant. Default value of attribute.

Prompt Optional Variant. Prompt for attribute.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddAttributeDefinition(Tag, X0, Y0, Z0, Height, Angle, Width, Offset, Justification, AttFlags, Default, Prompt)

expression Required. An expression that returns a Graphics object.

Tag Required String. The text string for the attribute definition tag.

X0 Required Double. X coordinate of attdef's starting point.

Y0 Required Double. Y coordinate of attdef's starting point.

Z0 Required Double. Z coordinate of attdef's starting point.

Height Required Double. Height of attdef object.

Angle Required Variant. Rotation angle of attdef in radians.

Width Optional Variant. Width of attdef object.

Offset Optional Variant. An ImsiTextOffset.

Justification Optional Variant. An ImsiTextJustification.

AttFlags Optional Variant. ImsiAttFlag values.

Default Optional Variant. Default value of attribute.

Prompt Optional Variant. Prompt for attribute.

Return Value

Graphic. The newly created Graphic object.

Syntax 3

expression.AddAttributeDefinition(Tag, X0, Y0, Z0, Height, Angle, Width, Offset, Justification, AttFlags, Default, Prompt)

expression Required. An expression that returns a Layer object.

Tag Required String. The text string for the attribute definition tag.

X0 Required Double. X coordinate of attdef's starting point.

Y0 Required Double. Y coordinate of attdef's starting point.

Z0 Required Double. Z coordinate of attdef's starting point.

Height Required Double. Height of attdef object.

Angle Required Variant. Rotation angle of attdef in radians.

Width Optional Variant. Width of attdef object.

Offset Optional Variant. An ImsiTextOffset.

Justification Optional Variant. An ImsiTextJustification.

AttFlags Optional Variant. ImsiAttFlag values.

Default Optional Variant. Default value of attribute.

Prompt Optional Variant. Prompt for attribute.

Return Value

Graphic. The newly created Graphic object.


AddBlockInsertion Method

Adds a block insertion to the collection.

Syntax

expression.AddBlockInsertion(Block, X0, Y0, Z0, XScale, YScale, ZScale, Angle)

expression Required. An expression that returns a Graphics object.

Block Required Variant. BlockObj or index of the block.

X0 Required Variant. X coordinate of the block insertion point.

Y0 Optional Variant. Y coordinate of the block insertion point.

Z0 Optional Variant. Z coordinate of the block insertion point.

XScale Optional Variant. X scale factor.

YScale Optional Variant. Y scale factor.

ZScale Optional Variant. Z scale factor.

Angle Optional Variant. Rotation angle of block insertion in radians.

Return Value

Graphic. The newly created Graphic object.


AddCircle Method

Creates and adds a circle marker to the collection.

Syntax 1

expression.AddCircle(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCircle(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.


AddCircleCenterAndPoint Method

Creates and adds a circle to the collection.

Syntax 1

expression.AddCircleCenterAndPoint(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the center point.

Y0 Required Double. Y coordinate of the center point.

Z0 Required Double. Z coordinate of the cneter point.

X1 Required Double. X coordinate of the radius point.

Y1 Required Double. Y coordinate of the radius point.

Z1 Required Double. Z coordinate of the radius point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCircleCenterAndPoint(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the center point.

Y0 Required Double. Y coordinate of the center point.

Z0 Required Double. Z coordinate of the cneter point.

X1 Required Double. X coordinate of the radius point.

Y1 Required Double. Y coordinate of the radius point.

Z1 Required Double. Z coordinate of the radius point.

Return Value

Graphic. The newly created Graphic object.


AddCircleDoublePoint Method

Creates and adds a circle to the collection.

Syntax 1

expression.AddCircleDoublePoint(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCircleDoublePoint(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

Return Value

Graphic. The newly created Graphic object.


AddCircleTriplePoint Method

Creates and adds a circle to the collection.

Syntax 1

expression.AddCircleTriplePoint(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

X2 Required Double. X coordinate of the third point.

Y2 Required Double. Y coordinate of the third point.

Z2 Required Double. Z coordinate of the third point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCircleTriplePoint(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

X2 Required Double. X coordinate of the third point.

Y2 Required Double. Y coordinate of the third point.

Z2 Required Double. Z coordinate of the third point.

Return Value

Graphic. The newly created Graphic object.


AddClose Method

Creates a new Vertex object and closes the collection's Graphic object.

Syntax

expression.AddClose(PenDown, Selectable, Snappable, Editable, Linkable, Calculated)

expression Required. An expression that returns a Vertices object.

PenDown Required Variant. True if the segment to this vertex is drawn.

Selectable Optional Variant. True if the vertex can be selected.

Snappable Optional Variant. True if the vertex can be snapped to.

Editable Optional Variant. True if the vertex can be edited.

Linkable Optional Variant. True if the vertex can be linked to.

Calculated Optional Variant. True if the Vertex object is recalculated by the RegenMethod.

Return Value

Vertex. The newly created Vertex object.


AddConstructionAngularLine Method

Creates and adds a construction line to the collection.

Syntax 1

expression.AddConstructionAngularLine(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first point on line.

Y0 Required Double. Y coordinate of the first point on line.

Z0 Required Double. Z coordinate of the first point on line.

X1 Required Double. X coordinate of the second point on line.

Y1 Required Double. Y coordinate of the second point on line.

Z1 Required Double. Z coordinate of the second point on line.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddConstructionAngularLine(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first point on line.

Y0 Required Double. Y coordinate of the first point on line.

Z0 Required Double. Z coordinate of the first point on line.

X1 Required Double. X coordinate of the second point on line.

Y1 Required Double. Y coordinate of the second point on line.

Z1 Required Double. Z coordinate of the second point on line.

Return Value

Graphic. The newly created Graphic object.


AddConstructionCenterAndPointCircle Method

Creates and adds a construction circle to the collection.

Syntax 1

expression.AddConstructionCenterAndPointCircle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the center point.

Y0 Required Double. Y coordinate of the center point.

Z0 Required Double. Z coordinate of the center point.

X1 Required Double. X coordinate of the perimeter point.

Y1 Required Double. Y coordinate of the perimeter point.

Z1 Required Double. Z coordinate of the perimeter point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddConstructionCenterAndPointCircle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the center point.

Y0 Required Double. Y coordinate of the center point.

Z0 Required Double. Z coordinate of the center point.

X1 Required Double. X coordinate of the perimeter point.

Y1 Required Double. Y coordinate of the perimeter point.

Z1 Required Double. Z coordinate of the perimeter point.

Return Value

Graphic. The newly created Graphic object.


AddConstructionDoublePointCircle Method

Creates and adds a construction circle to the collection.

Syntax 1

expression.AddConstructionDoublePointCircle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddConstructionDoublePointCircle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

Return Value

Graphic. The newly created Graphic object.


AddConstructionHorizontalLine Method

Creates and adds a construction line to the collection.

Syntax 1

expression.AddConstructionHorizontalLine(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the line.

Y0 Required Double. Y coordinate of the line.

Z0 Required Double. Z coordinate of the line.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddConstructionHorizontalLine(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the line.

Y0 Required Double. Y coordinate of the line.

Z0 Required Double. Z coordinate of the line.

Return Value

Graphic. The newly created Graphic object.


AddConstructionTriplePointCircle Method

Creates and adds a construction circle to the collection.

Syntax 1

expression.AddConstructionTriplePointCircle(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

X2 Required Double. X coordinate of the third point.

Y2 Required Double. Y coordinate of the third point.

Z2 Required Double. Z coordinate of the third point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddConstructionTriplePointCircle(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first point.

Y0 Required Double. Y coordinate of the first point.

Z0 Required Double. Z coordinate of the first point.

X1 Required Double. X coordinate of the second point.

Y1 Required Double. Y coordinate of the second point.

Z1 Required Double. Z coordinate of the second point.

X2 Required Double. X coordinate of the third point.

Y2 Required Double. Y coordinate of the third point.

Z2 Required Double. Z coordinate of the third point.

Return Value

Graphic. The newly created Graphic object.


AddConstructionVerticalLine Method

Creates and adds a construction line to the collection.

Syntax 1

expression.AddConstructionVerticalLine(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the line.

Y0 Required Double. Y coordinate of the line.

Z0 Required Double. Z coordinate of the line.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddConstructionVerticalLine(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the line.

Y0 Required Double. Y coordinate of the line.

Z0 Required Double. Z coordinate of the line.

Return Value

Graphic. The newly created Graphic object.


AddCross Method

Creates and adds a cross marker to the collection.

Syntax 1

expression.AddCross(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCross(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.


AddCurveBezier Method

Creates and adds a bezier curve to the collection.

Remarks

The returned Graphic object contains only a beginning vertex. The user must use subsequent Graphic.NextPoint calls to add segments to the Graphic object, and a Graphic.Finish call to complete the Graphic object.

Syntax 1

expression.AddCurveBezier(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first endpoint.

Y0 Required Double. Y coordinate of the first endpoint.

Z0 Required Double. Z coordinate of the first endpoint.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCurveBezier(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first endpoint.

Y0 Required Double. Y coordinate of the first endpoint.

Z0 Required Double. Z coordinate of the first endpoint.

Return Value

Graphic. The newly created Graphic object.


AddCurveSpline Method

Creates and adds a cubic spline curve to the collection.

Remarks

The returned Graphic object contains only a beginning vertex. The user must use subsequent Graphic.NextPoint calls to add segments to the Graphic object, and a Graphic.Finish call to complete the Graphic object.

Syntax 1

expression.AddCurveSpline(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first endpoint.

Y0 Required Double. Y coordinate of the first endpoint.

Z0 Required Double. Z coordinate of the first endpoint.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddCurveSpline(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first endpoint.

Y0 Required Double. Y coordinate of the first endpoint.

Z0 Required Double. Z coordinate of the first endpoint.

Return Value

Graphic. The newly created Graphic object.


AddDot Method

Creates and adds a dot marker to the collection.

Syntax 1

expression.AddDot(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddDot(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.


AddEllipse Method

Creates and adds a ellipse to the collection.

Syntax 1

expression.AddEllipse(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of bounding rectangle's upper left corner.

Y0 Required Double. Y coordinate of bounding rectangle's upper left corner.

Z0 Required Double. Z coordinate of bounding rectangle's upper left corner.

X1 Required Double. X coordinate of bounding rectangle's lower right corner.

Y1 Required Double. Y coordinate of bounding rectangle's lower right corner.

Z1 Required Double. Z coordinate of bounding rectangle's lower right corner.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddEllipse(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of bounding rectangle's upper left corner.

Y0 Required Double. Y coordinate of bounding rectangle's upper left corner.

Z0 Required Double. Z coordinate of bounding rectangle's upper left corner.

X1 Required Double. X coordinate of bounding rectangle's lower right corner.

Y1 Required Double. Y coordinate of bounding rectangle's lower right corner.

Z1 Required Double. Z coordinate of bounding rectangle's lower right corner.

Return Value

Graphic. The newly created Graphic object.


AddEllipseFixedRatio Method

Creates and adds a ellipse to the collection.

Syntax 1

expression.AddEllipseFixedRatio(X0, Y0, Z0, X1, Y1, Z1, XToYRatio)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of ellipse's center point.

Y0 Required Double. Y coordinate of ellipse's center point.

Z0 Required Double. Z coordinate of ellipse's center point.

X1 Required Double. X coordinate of radius in Y direction.

Y1 Required Double. Y coordinate of radius in Y direction.

Z1 Required Double. Z coordinate of radius in Y direction.

XToYRatio Required Double. Ratio of Rx to Ry.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddEllipseFixedRatio(X0, Y0, Z0, X1, Y1, Z1, XToYRatio)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of ellipse's center point.

Y0 Required Double. Y coordinate of ellipse's center point.

Z0 Required Double. Z coordinate of ellipse's center point.

X1 Required Double. X coordinate of radius in Y direction.

Y1 Required Double. Y coordinate of radius in Y direction.

Z1 Required Double. Z coordinate of radius in Y direction.

XToYRatio Required Double. Ratio of Rx to Ry.

Return Value

Graphic. The newly created Graphic object.


AddEllipseRotatedEllipse Method

Creates and adds a ellipse to the collection.

Syntax 1

expression.AddEllipseRotatedEllipse(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of ellipse's center point.

Y0 Required Double. Y coordinate of ellipse's center point.

Z0 Required Double. Z coordinate of ellipse's center point.

X1 Required Double. X coordinate of major axis radius point.

Y1 Required Double. Y coordinate of major axis radius point.

Z1 Required Double. Z coordinate of major axis radius point.

X2 Required Double. X coordinate of minor axis radius point.

Y2 Required Double. Y coordinate of minor axis radius point.

Z2 Required Double. Z coordinate of minor axis radius point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddEllipseRotatedEllipse(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of ellipse's center point.

Y0 Required Double. Y coordinate of ellipse's center point.

Z0 Required Double. Z coordinate of ellipse's center point.

X1 Required Double. X coordinate of major axis radius point.

Y1 Required Double. Y coordinate of major axis radius point.

Z1 Required Double. Z coordinate of major axis radius point.

X2 Required Double. X coordinate of minor axis radius point.

Y2 Required Double. Y coordinate of minor axis radius point.

Z2 Required Double. Z coordinate of minor axis radius point.

Return Value

Graphic. The newly created Graphic object.


AddGraphic Method

Adds an existing Graphic object to the collection.

Syntax 1

expression.AddGraphic(Graphic, Before, After)

expression Required. An expression that returns a Graphics object.

Graphic Required Graphic. The Graphic object to add.

Before Optional Variant. The Graphic object or index that will follow the added Graphic object.

After Optional Variant. The Graphic object or index that will precede the added Graphic object.

Syntax 2

expression.AddGraphic(Graphic, Before, After)

expression Required. An expression that returns a GraphicSet object.

Graphic Required Graphic. The Graphic object to add.

Before Optional Variant. The Graphic object or index that will follow the added Graphic object.

After Optional Variant. The Graphic object or index that will precede the added Graphic object.

Syntax 3

expression.AddGraphic(Graphic, Before, After)

expression Required. An expression that returns a Layer object.

Graphic Required Graphic. The Graphic object to add.

Before Optional Variant. The Graphic object or index that will follow the added Graphic object.

After Optional Variant. The Graphic object or index that will precede the added Graphic object.

Syntax 4

expression.AddGraphic(Graphic, Before, After)

expression Required. An expression that returns a Selection object.

Graphic Required Graphic. The Graphic object to add.

Before Optional Variant. The Graphic object or index that will follow the added Graphic object.

After Optional Variant. The Graphic object or index that will precede the added Graphic object.

Syntax 5

expression.AddGraphic(Graphic)

expression Required. An expression that returns an UndoRecord object.

Graphic Required Graphic. The Graphic object to delete when Undo is called.


AddGraphicForModify Method

Add a reference to a Graphic that has been modified.

Syntax

expression.AddGraphicForModify(Graphic)

expression Required. An expression that returns an UndoRecord object.

Graphic Required Graphic. The Graphic object to restore when Undo is called.


AddHatch Method

Adds a hatch pattern to the collection from the Graphic objects in the collection.

Syntax

expression.AddHatch

expression Required. An expression that returns a Graphics object.

Return Value

Graphic. The newly created Graphic object.


AddItem Method

Adds an item to the BrushPattern object.

Syntax

expression.AddItem(Dashes, XOrigin, YOrigin, Angle)

expression Required. An expression that returns a BrushPattern object.

Dashes Required Variant. The line style.

XOrigin Required Double. The x coordinate of the pattern's origin.

YOrigin Required Double. The y coordinate of the pattern's origin.

Angle Required Double. The angle of the line in radians.


AddLineIrregularPolygon Method

Creates and adds an irregular polygon to the collection.

Remarks

The returned Graphic object contains only a beginning vertex. The user must use subsequent Graphic.NextPoint calls to add segments to the Graphic object, and a Graphic.Close call to complete the Graphic object.

Syntax 1

expression.AddLineIrregularPolygon(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of first endpoint.

Y0 Required Double. Y coordinate of first endpoint.

Z0 Required Double. Z coordinate of first endpoint.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLineIrregularPolygon(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of first endpoint.

Y0 Required Double. Y coordinate of first endpoint.

Z0 Required Double. Z coordinate of first endpoint.

Return Value

Graphic. The newly created Graphic object.


AddLineMultiline Method

Creates and adds a multiple segment line to the collection.

Remarks

The returned Graphic object contains only a beginning vertex. The user must use subsequent Graphic.NextPoint calls to add segments to the Graphic object, and a Graphic.Finish call to complete the Graphic object.

Syntax 1

expression.AddLineMultiline(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of first endpoint.

Y0 Required Double. Y coordinate of first endpoint.

Z0 Required Double. Z coordinate of first endpoint.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLineMultiline(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of first endpoint.

Y0 Required Double. Y coordinate of first endpoint.

Z0 Required Double. Z coordinate of first endpoint.

Return Value

Graphic. The newly created Graphic object.


AddLineParallel Method

Creates and adds a single line segment to the collection.

Syntax 1

expression.AddLineParallel(ParallelTo, X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

ParallelTo Required Graphic. Line to make new line parallel to.

X0 Required Double. X coordinate of the new line.

Y0 Required Double. Y coordinate of the new line.

Z0 Required Double. Z coordinate of the new line.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLineParallel(ParallelTo, X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

ParallelTo Required Graphic. Line to make new line parallel to.

X0 Required Double. X coordinate of the new line.

Y0 Required Double. Y coordinate of the new line.

Z0 Required Double. Z coordinate of the new line.

Return Value

Graphic. The newly created Graphic object.


AddLinePerpendicular Method

Creates and adds a single line segment to the collection.

Syntax 1

expression.AddLinePerpendicular(PerpTo, X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

PerpTo Required Graphic. Line to make new line perpendicular to.

X0 Required Double. X coordinate of the point on the existing line.

Y0 Required Double. Y coordinate of the point on the existing line.

Z0 Required Double. Z coordinate of the point on the existing line.

X1 Required Double. X coordinate of the second point on the new line.

Y1 Required Double. Y coordinate of the second point on the new line.

Z1 Required Double. Z coordinate of the second point on the new line.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLinePerpendicular(PerpTo, X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

PerpTo Required Graphic. Line to make new line perpendicular to.

X0 Required Double. X coordinate of the point on the existing line.

Y0 Required Double. Y coordinate of the point on the existing line.

Z0 Required Double. Z coordinate of the point on the existing line.

X1 Required Double. X coordinate of the second point on the new line.

Y1 Required Double. Y coordinate of the second point on the new line.

Z1 Required Double. Z coordinate of the second point on the new line.

Return Value

Graphic. The newly created Graphic object.


AddLinePolygon Method

Creates and adds a regular polygon to the collection.

Syntax 1

expression.AddLinePolygon(X0, Y0, Z0, X1, Y1, Z1, nsides)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the center point.

Y0 Required Double. Y coordinate of the center point.

Z0 Required Double. Z coordinate of the center point.

X1 Required Double. X coordinate of the corner point.

Y1 Required Double. Y coordinate of the corner point.

Z1 Required Double. Z coordinate of the corner point.

nsides Required Long. number of sides.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLinePolygon(X0, Y0, Z0, X1, Y1, Z1, nsides)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the center point.

Y0 Required Double. Y coordinate of the center point.

Z0 Required Double. Z coordinate of the center point.

X1 Required Double. X coordinate of the corner point.

Y1 Required Double. Y coordinate of the corner point.

Z1 Required Double. Z coordinate of the corner point.

nsides Required Long. number of sides.

Return Value

Graphic. The newly created Graphic object.


AddLineRectangle Method

Creates and adds a rectangle to the collection.

Syntax 1

expression.AddLineRectangle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the upper left corner.

Y0 Required Double. Y coordinate of the upper left corner.

Z0 Required Double. Z coordinate of the upper left corner.

X1 Required Double. X coordinate of the lower right corner.

Y1 Required Double. Y coorindate of the lower right corner.

Z1 Required Double. Z coorindate of the lower right corner.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLineRectangle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the upper left corner.

Y0 Required Double. Y coordinate of the upper left corner.

Z0 Required Double. Z coordinate of the upper left corner.

X1 Required Double. X coordinate of the lower right corner.

Y1 Required Double. Y coorindate of the lower right corner.

Z1 Required Double. Z coorindate of the lower right corner.

Return Value

Graphic. The newly created Graphic object.


AddLineRotatedRectangle Method

Creates and adds a rotated rectangle to the collection.

Syntax 1

expression.AddLineRotatedRectangle(X0, Y0, Z0, X1, Y1, Z1, Height)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the upper left corner.

Y0 Required Double. Y coordinate of the upper left corner.

Z0 Required Double. Z coordinate of the upper left corner.

X1 Required Double. X coordinate of the lower right corner.

Y1 Required Double. Y coorindate of the lower right corner.

Z1 Required Double. Z coorindate of the lower right corner.

Height Required Double. Height of the rectangle.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLineRotatedRectangle(X0, Y0, Z0, X1, Y1, Z1, Height)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the upper left corner.

Y0 Required Double. Y coordinate of the upper left corner.

Z0 Required Double. Z coordinate of the upper left corner.

X1 Required Double. X coordinate of the lower right corner.

Y1 Required Double. Y coorindate of the lower right corner.

Z1 Required Double. Z coorindate of the lower right corner.

Height Required Double. Height of the rectangle.

Return Value

Graphic. The newly created Graphic object.


AddLineSingle Method

Creates and adds a single line segment to the collection.

Syntax 1

expression.AddLineSingle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the first endpoint.

Y0 Required Double. Y coordinate of the first endpoint.

Z0 Required Double. Z coordinate of the first endpoint.

X1 Required Double. X coordinate of the second endpoint.

Y1 Required Double. Y coordinate of the second endpoint.

Z1 Required Double. Z coordinate of the second endpoint.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddLineSingle(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the first endpoint.

Y0 Required Double. Y coordinate of the first endpoint.

Z0 Required Double. Z coordinate of the first endpoint.

X1 Required Double. X coordinate of the second endpoint.

Y1 Required Double. Y coordinate of the second endpoint.

Z1 Required Double. Z coordinate of the second endpoint.

Return Value

Graphic. The newly created Graphic object.


AddPolylines Method

Creates and adds a bunch of polylines to the collection. The returned Graphics object contains a set with freshly created polygons. The user can set properties, etc.

Syntax

expression.AddPolylines(NumberOfPolylines, Coords, Closed)

expression Required. An expression that returns a Graphics object.

NumberOfPolylines Required Long. Number of polylines to create.

Coords Required Variant. SafeArray of triplets of coordinates.

Closed Required Boolean. Whether each polyline is closed.

Return Value

GraphicSet. The newly created set of Graphic objects.


AddPolys Method

Creates and adds a group of polylines or polygons to the collection.

Syntax

expression.AddPolys(Type, Coords)

expression Required. An expression that returns a Graphics object.

Type Required imsiPolyType. Type of poly(s) to be added.

Coords Required Variant. Array of (X, Y, Z) poly coordinates.

Return Value

GraphicSet. The newly created Graphic objects.


AddSquare Method

Creates and adds a square marker to the collection.

Syntax 1

expression.AddSquare(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddSquare(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.


AddStar Method

Creates and adds a star to the collection.

Syntax 1

expression.AddStar(X0, Y0, Z0)

expression Required. An expression that returns a Graphics object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddStar(X0, Y0, Z0)

expression Required. An expression that returns a Layer object.

X0 Required Double. X coordinate of the point.

Y0 Required Double. Y coordinate of the point.

Z0 Required Double. Z coordinate of the point.

Return Value

Graphic. The newly created Graphic object.


AddText Method

Creates and adds a text Graphic object to the collection.

Syntax 1

expression.AddText(Text, X0, Y0, Z0, Height, Angle, Width, Offset, Justification)

expression Required. An expression that returns a Graphics object.

Text Required String. The text string.

X0 Required Double. X coordinate of text's starting point.

Y0 Required Double. Y coordinate of text's starting point.

Z0 Required Double. Z coordinate of text's starting point.

Height Required Double. Height of text object.

Angle Required Variant. Rotation angle of text in radians.

Width Optional Variant. Width of text object.

Offset Optional Variant. An ImsiTextOffset.

Justification Optional Variant. An ImsiTextJustification.

Return Value

Graphic. The newly created Graphic object.

Syntax 2

expression.AddText(Text, X0, Y0, Z0, Height, Angle, Width, Offset, Justification)

expression Required. An expression that returns a Layer object.

Text Required String. The text string.

X0 Required Double. X coordinate of text's starting point.

Y0 Required Double. Y coordinate of text's starting point.

Z0 Required Double. Z coordinate of text's starting point.

Height Required Double. Height of text object.

Angle Required Variant. Rotation angle of text in radians.

Width Optional Variant. Width of text object.

Offset Optional Variant. An ImsiTextOffset.

Justification Optional Variant. An ImsiTextJustification.

Return Value

Graphic. The newly created Graphic object.


AddTie Method

Add a Tie object to the TieSet.

Syntax 1

expression.AddTie(pvarTM, dblPriority, pvarData)

expression Required. An expression that returns a TieSet object.

pvarTM Required Variant. A TieMethod object or index.

dblPriority Required Double. Priority of the tie. Defines the order of tie processing.

pvarData Required Variant. TieMethod specific data. Used when TieMethod updates the tie.

Return Value

Tie. The newly created Tie object.


AddUndoRecord Method

Opens a new UndoRecord in the Drawing object.

Remarks

Use UndoRecord.AddGraphic, etc. to add graphics to the record. Use UndoRecord.Close to close the record and add it to the Undo list.

Syntax

expression.AddUndoRecord(MenuText)

expression Required. An expression that returns a Drawing object.

MenuText Required String. The prompt to appear in the Undo list.

Return Value

UndoRecord. The new UndoRecord object.


AddVertex Method

Adds an existing Vertex object to the collection.

Syntax

expression.AddVertex(Vertex, Before, After)

expression Required. An expression that returns a Vertices object.

Vertex Required Vertex. The Vertex object to be added.

Before Optional Variant. Vertex object or index to follow this one.

After Optional Variant. Vertex object or index to precede this one.


AddXRef Method

Adds a new Block object to the collection.

Syntax

expression.AddXRef(Name, Path, XRef, YRef, ZRef)

expression Required. An expression that returns a Blocks object.

Name Required String. The name of the new Block object.

Path Required String. path to the eXternal Reference file

XRef Required Variant. X coordinate of the block reference point.

YRef Optional Variant. Y coordinate of the block reference point.

ZRef Optional Variant. Z coordinate of the block reference point.

Return Value

Block. The newly created Block object.


ArcSet Method

Set the center, radius, and other arc parameters.

Syntax

expression.ArcSet(XCenter, YCenter, ZCenter, MajorAxis, MinorAxis, StartAngle, EndAngle, RotationAngle)

expression Required. An expression that returns a Graphic object.

XCenter Optional Variant. X coordinate of arc center point.

YCenter Optional Variant. Y coordinate of arc center point.

ZCenter Optional Variant. Z coordinate of arc center point.

MajorAxis Optional Variant. Length of major axis.

MinorAxis Optional Variant. Length of minor axis.

StartAngle Optional Variant. Starting angle in radians.

EndAngle Optional Variant. Ending angle in radians.

RotationAngle Optional Variant. Rotation angle of major axis in radians.


BeginRender Method

Starts a new, or restarts the existing rendering job for the RenderView.

Syntax

expression.BeginRender(WhichRender)

expression Required. An expression that returns a RenderView object.

WhichRender Required Integer. Index of Render Object.


BringToFront Method

Brings the Graphic object to the front.

Syntax

expression.BringToFront

expression Required. An expression that returns a Graphic object.


CalcBoundingBox Method

Returns the Graphic object's bounding box.

Remarks

If Transform parameter is omitted then bounding box will be calculated in the world coordinate system. Otherwise this parameter should contain a matrix object describing the desired UCS.

Syntax 1

expression.CalcBoundingBox(Transform)

expression Required. An expression that returns a Graphic object.

Transform Optional. Variant. A transformation Matrix object.

Return Value

BoundingBox. The BoundingBox object.

Syntax 2

expression.CalcBoundingBox(Transform)

expression Required. An expression that returns a Graphics object.

Transform Optional. Variant. A transformation Matrix object.

Return Value

BoundingBox. The BoundingBox object.

Syntax 3

expression.CalcBoundingBox(Transform)

expression Required. An expression that returns a Selection object.

Transform Optional. Variant. A transformation Matrix object.

Return Value

BoundingBox. The BoundingBox object.


CameraSetSpaceParameters Method

Set all camera vectors : Location, LookAt and Up.

Syntax

expression.CameraSetSpaceParameters(pvPos, pvLook, pvU)

expression Required. An expression that returns a Camera object.

pvPos Required Vertex. Location vertex.

pvLook Required Vertex. LookAt vertex.

pvU Required Vertex. Up vertex.


Clear Method

Deletes the collection's Vertex objects.

Syntax

expression.Clear(Types)

expression Required. An expression that returns a Vertices object.

Types Optional Variant. If supplied, the types of Vertex objects to delete.


Close Method

Closes the object or objects (case of Drawings collection).

Syntax 1

expression.Close(SaveChanges, Filename, Filter)

expression Required. An expression that returns a Drawing object.

SaveChanges Optional Variant. True to save changes.

Filename Optional Variant. Alternate file name to save as.

Filter Optional Variant. Name or index of preferred filter.

Syntax 2

expression.Close

expression Required. An expression that returns a Drawings object.

Syntax 3

expression.Close

expression Required. An expression that returns an Graphic object.

Syntax 4

expression.Close

expression Required. An expression that returns an UndoRecord object.


CloseBitmapBitsDC Method

Closes the bitmap DC and returns the bitmap bits in a SAFEARRAY.

Syntax

expression.CloseBitmapBitsDC

expression Required. An expression that returns a View object.

Return Value

Variant. SAFEARRAY of bitmap bits.


CloseBitmapDC Method

Closes the bitmap DC, and returns a bitmap handle.

Syntax

expression.CloseBitmapDC

expression Required. An expression that returns a View object.

Return Value

Long. The bitmap handle.


CloseBitmapPictDC Method

Closes the bitmap DC, and returns a Picture object.

Syntax

expression.CloseBitmapPictDC

expression Required. An expression that returns a View object.

Return Value

Object. A Picture object.


CloseMetafileBitsDC Method

Closes the metafile DC and returns the metafile bits in a SAFEARRAY.

Syntax

expression.CloseMetafileBitsDC

expression Required. An expression that returns a View object.

Return Value

Variant. SAFEARRAY of metfile bits.


CloseMetafileDC Method

Closes the metafile DC, and returns a metafile handle.

Syntax

expression.CloseMetafileDC

expression Required. An expression that returns a View object.

Return Value

Long. The metafile handle.


CloseMetafilePictDC Method

Closes the metafile DC and returns a Picture object.

Syntax

expression.CloseMetafilePictDC

expression Required. An expression that returns a View object.

Return Value

Object. A Picture object.


ConnectEvents Method

Connects an ApplicationEvents object sink to TurboCAD. Set the mask parameter to only receive a subset of the full event set.

Syntax

expression.ConnectEvents(EventSink, EventMask)

expression Required. An expression that returns an Application object.

EventSink Required Object. Object that will receive events.

EventMask Required Variant. Mask bits or'ed together (see ImsiEventMask).

Return Value

Long. ID to be used in DisconnectEvents method.


CreateBlock Method

Creates a block in the Drawing object from the Graphic objects in the collection.

Syntax

expression.CreateBlock(Name, XRef, YRef, ZRef, CopyGraphics, InsertBlock, Insert)

expression Required. An expression that returns a Graphics object.

Name Required String. Name for the new block.

XRef Required Variant. X coordinate of the block reference point.

YRef Optional Variant. Y coordinate of the block reference point.

ZRef Optional Variant. Z coordinate of the block reference point.

CopyGraphics Optional Variant. True to make the group using copies of the Graphic objects in the Graphics collection.

InsertBlock Optional Variant. True to insert the new block in the Drawing object.

Insert Optional Variant. The Insert Graphic object if InsertBlock was true

Return Value

Block. The newly created block.


CreateDragOutline Method

Generates a bounding polygon array to use in drag operations.

Syntax 1

expression.CreateDragOutline(Coords)

expression Required. An expression that returns a Graphic object.

Coords Required Variant. Array of (X, Y, Z) polygon coordinates.

Syntax 2

expression.CreateDragOutline(Coords)

expression Required. An expression that returns a Graphics object.

Coords Required Variant. Array of (X, Y, Z) polygon coordinates.


Delete Method

Deletes the object.

Syntax 1

expression.Delete

expression Required. An expression that returns a Block object.

Syntax 2

expression.Delete

expression Required. An expression that returns a Filter object.

Syntax 3

expression.Delete

expression Required. An expression that returns a Graphic object.

Syntax 4

expression.Delete

expression Required. An expression that returns a GraphicSet object.

Syntax 5

expression.Delete

expression Required. An expression that returns a Layer object.

Syntax 6

expression.Delete

expression Required. An expression that returns a Macro object.

Syntax 7

expression.Delete

expression Required. An expression that returns a NamedColor object.

Syntax 8

expression.Delete

expression Required. An expression that returns a NamedView object.

Syntax 9

expression.Delete

expression Required. An expression that returns a Property object.

Syntax 10

expression.Delete

expression Required. An expression that returns a Render object.

Syntax 11

expression.Delete

expression Required. An expression that returns a TieSet object.

Syntax 12

expression.Delete

expression Required. An expression that returns a UndoRecord object.

Syntax 13

expression.Delete

expression Required. An expression that returns a Vertex object.

Syntax 14

expression.Delete

expression Required. An expression that returns a View object.


DeleteGraphic Method

Deletes the Graphic object, adding a purged reference to the UndoRecord object.

Syntax

expression.DeleteGraphic(Graphic)

expression Required. An expression that returns an UndoRecord object.

Graphic Required Graphic. The Graphic object to add when Undo is called.


DeleteGraphics Method

Deletes the Graphics collection, adding a purged references to the UndoRecord object.

Syntax

expression.DeleteGraphics(pGrs, pvarFlags)

expression Required. An expression that returns an UndoRecord object.

pGrs Required Graphics. The Graphics collection to add when Undo is called.

pvarFlags Optional Variant. Flags defining delete operation. See remarks.

Remarks

pvarFlags can have the following values:

0x00000001 corresponds to GraphicDeleted = False
0x00000002 corresponds to Graphic.Visible = True
0x00000004 corresponds to Graphic.Properties("Selected")
0x00000008 corresponds to Graphic.Deleted = True
0x00000040 corresponds to Graphic.Properties("LimitVertices")
0x00000080 corresponds to Graphic.Cosmetic = True
0x00000200 corresponds to Graphic.Unbounded = True
0x00000400 corresponds to Graphic.Editable = False


DirToNearestFace Method

Finds the side of a BoundingBox closest to a given location.

Syntax

expression.DirToNearestFace(Vertex, IgnoreZAxis, OtherVertex)

expression Required. An expression that returns a BoundingBox object.

Vertex Required Vertex. The location to be tested.

IgnoreZAxis Required Boolean. True if testing is only to be done on X and Y axes of the BoundingBox.

OtherVertex Optional Vertex. Ignored; reserved for future use.

Return Value

ImsiDirection. The side of the BoundingBox closest to the given location. These values are:

imsiDirZPos = 1 (Vertex.Z - BoundingBox.Max.Z)
imsiDirYPos = 2 (Vertex.Y - BoundingBox.Max.Y)
imsiDirXPos = 3 (Vertex.X - BoundingBox.Max.X)
imsiDirXNeg = 4 (Vertex.X - BoundingBox.Min.X)
imsiDirYNeg = 5 (Vertex.Y - BoundingBox.Min.Y)
imsiDirZNeg = 6 (Vertex.Z - BoundingBox.Min.Z)


DisconnectEvents Method

Disconnects an ApplicationEvents object sink.

Syntax

expression.DisconnectEvents(ConnectionID)

expression Required. An expression that returns an Application object.

ConnectionID Required Long. ID returned by ConnectEvents method.


DoRender Method

Starts another rendering job for the RenderView object.

Remarks

Returns an error if the RenderView object has not been initialized by a previous call to BeginRender, or is currently in the middle of a rendering process.

Syntax

expression.DoRender

expression Required. An expression that returns a RenderView object.


DragOutline Method

Begin, continue or end a drag operation.

Syntax

expression.DragOutline(Coords, XScreen, YScreen, DragState)

expression Required. An expression that returns a View object.

Coords Required Variant. Array of (X, Y, Z) polygon coordinates.

XScreen Required Double. X coordinate of point in screen coordinate system.

YScreen Required Double. Y coordinate of point in screen coordinate system.

DragState Optional Variant. Begin, continue or end of drag operation


Draw Method

Draws the Graphic object.

Syntax 1

expression.Draw(View)

expression Required. An expression that returns a Graphic object.

View Optional Variant. If supplied, the View object to draw on.

Syntax 2

expression.Draw(View)

expression Required. An expression that returns a Graphics object.

View Optional Variant. If supplied, the View object to draw on.

Syntax 3

expression.Draw(View)

expression Required. An expression that returns a Selection object.

View Optional Variant. If supplied, the View object to draw on.


Duplicate Method

Duplicates the object and returns a reference to the new copy.

Syntax 1

expression.Duplicate

expression Required. An expression that returns a Graphic object.

Return Value

Graphic. The duplicated Graphic object.

Syntax 2

expression.Duplicate

expression Required. An expression that returns a Matrix object.

Return Value

Matrix. The duplicated Matrix object.

Syntax 3

expression.Duplicate(Name)

expression Required. An expression that returns a NamedColor object.

Name Required String. The name of the NamedColor object.

Return Value

NamedColor. The duplicated NamedColor object.

Syntax 4

expression.Duplicate

expression Required. An expression that returns a Vertex object.

Return Value

Vertex. The duplicated Vertex object.


EndRender Method

Terminates the current rendering process.

Syntax

expression.EndRender

expression Required. An expression that returns a RenderView object.


Enumerate Method

Returns the ids, names and types of the collection.

Syntax

expression.Enumerate(IDs, Names, Types)

expression Required. An expression that returns a Properties object.

IDs Required Variant. An array of longs.

Names Required Variant. An array of strings.

Types Required Variant. An array of longs.


Explode Method

Explodes a group or block insertion.

Syntax

expression.Explode

expression Required. An expression that returns a Graphic object.

Return Value

GraphicSet. The exploded Graphic objects.


GetArcData Method

Returns the Arc Graphic object's parameter information.

Remarks

Data is returned in an array as follows:

parameter[0] X coordinate of center point
parameter[1] Y coordinate of center point
parameter[2] Z coordinate of center point
parameter[3] X coordinate of major axis
parameter[4] Y coordinate of major axis
parameter[5] Z coordinate of major axis
parameter[6] ratio of minor/major axes (1.0 = circle)
parameter[7] start angle in radians
parameter[8] end angle in radians
parameter[9] 0.0 if open arc, 1.0 if closed (ellipse or circle)

Syntax

expression.GetArcData(varArcData)

expression Required. An expression that returns a Graphic object.

varArcData Required. Variant. An array of 10 double values.


GetArray Method

Fills an array with the values of a 4x4 matrix.

Syntax

expression.GetArray(ArrayEntries)

expression Required. An expression that returns a Matrix object.

ArrayEntries Required Variant. An array of 16 doubles.


GetDashes Method

Fills an array with dash lengths that make up the LineStyle object.

Syntax

expression.GetDashes(Dashes)

expression Required. An expression that returns a LineStyle object.

Dashes Required Variant. An array of doubles.


GetDistance Method

Returns the distance to the specified Graphic object.

Syntax

expression.GetDistance(X, Y, Z, ClosestVertex, ClosestChild)

expression Required. An expression that returns a Graphic object.

X Required Double. The x coordinate of the point to be tested.

Y Required Double. The y coordinate of the point to be tested.

Z Required Double. The z coordinate of the point to be tested.

ClosestVertex Required Variant. Returns closest Vertex to the point tested.

ClosestChild Optional Variant. Returns closest Graphic to the point tested.

Return Value

Double. The distance from (X, Y, Z) to the closest vertex.


GetEntries Method

Returns all the entries in the Matrix object.

Syntax

expression.GetEntries(e00, e01, e02, e03, e10, e11, e12, e13, e20, e21, e22, e23, e30, e31, e32, e33)

expression Required. An expression that returns a Matrix object.

e00 Required Double. The entry value.

e01 Required Double. The entry value.

e02 Required Double. The entry value.

e03 Required Double. The entry value.

e10 Required Double. The entry value.

e11 Required Double. The entry value.

e12 Required Double. The entry value.

e13 Required Double. The entry value.

e20 Required Double. The entry value.

e21 Required Double. The entry value.

e22 Required Double. The entry value.

e23 Required Double. The entry value.

e30 Required Double. The entry value.

e31 Required Double. The entry value.

e32 Required Double. The entry value.

e33 Required Double. The entry value.


GetEntry Method

Returns the entry at the index 'i' (row) and 'j' (column).

Syntax

expression.GetEntry(i, j)

expression Required. An expression that returns a Matrix object.

i Required Long. The row.

j Required Long. The column.

Return Value

Double. The Matrix entry value requested.


GetFaceData Method

Returns information on the mesh that defines a SURFACE or 3DMESH graphic type.

Remarks

You supply three undimensioned arrays to GetFaceData, dimensioned as follows:

Dim vtxCoords() As Double 'vertex coordinate array
Dim vtxIndices() As Long 'face vertex index array
Dim edgeFlags() As Long 'face edge flag array

The vertex coordinates array will contain the X, Y, and Z coordinates of the vertices that define the surface or 3D mesh.

The face vertex index array will contain a sequence of indices into the vertex coordinate array that define all the faces of the surface or mesh. Each face is defined by a sequence of non-negative index values (3 or 4 depending on the type of mesh), followed by a -1 value indicating the closure of the face.

The index values are coordinate indices; they must be multiplied by three to obtain the actual index to be used for the vertex coordinate array, which consists of triplets of X, Y, and Z values.

The face edge flag array can be read in parallel with the face vertex index array. Each value in the array is either 0 or 1, 1 representing a visible edge, and 0 representing an invisible edge.

Syntax

expression.GetFaceData(VertexArray, VertexIndices, EdgeFlags)

expression Required. An expression that returns a Graphic object.

VertexArray Required Variant. An array of (X, Y, Z) position values

VertexIndices Required Variant. An array of indices into the VertexArray

EdgeFlags Required Variant. An array of flags


GetFaceDimension Method

Returns the overall size of the mesh.

Remarks

GetFaceDimension fills its M and N arguments with the rectangular size of the 3DMESH (number of rows and columns in the mesh), and its facetCount argument with the number of faces of the SURFACE or 3DMESH graphic.

Syntax

expression.GetFaceDimension(M, N, facetCount)

expression Required. An expression that returns a Graphic object.

M Required Long. Number of rows in the graphic.

N Required Long. Number of columns in the graphic.

facetCount Required Long. Number of faces in the graphic.


GetItem Method

Returns an item in the BrushPattern object.

Syntax

expression.GetItem(Index, Dashes, XOrigin, YOrigin, Width, Height, Angle)

expression Required. An expression that returns a BrushPattern object.

Index Required Long. Index of item to return.

Dashes Required Variant. The line style.

XOrigin Required Double. The x coordinate of the pattern's origin.

YOrigin Required Double. The y coordinate of the pattern's origin.

Width Required Double. The width (x axis) of the pattern's origin.

Height Required Double. The height (y axis) of the pattern's origin.

Angle Required Double. The angle of the line in radians.


GetMouseClick Method

Return the coordinates of the point in the view coordinate system.

Syntax

expression.GetMouseClick(X, Y)

expression Required. An expression that returns a View object.

X Required Double. X coordinate of point in view coordinate system.

Y Required Double. Y coordinate of point in view coordinate system.


GetOpenFilename Method

Displays a dialog box that lets the user choose a file to open in TurboCAD.

Syntax

expression.GetOpenFilename(Filter, Title, ButtonText, MultiSelect)

expression Required. An expression that returns an Application object.

Filter Required Variant. If supplied, just use one filter.

Title Optional Variant. Title of dialog box.

ButtonText Optional Variant. Text for OK button.

MultiSelect Optional Variant. True to allow multiple selections.

Return Value

String. File name(s).


GetSaveAsFilename Method

Displays the standard Save As dialog box and gets a filename from the user without actually saving any files.

Syntax

expression.GetSaveAsFilename(InitialFilename, Filter, Title, ButtonText)

expression Required. An expression that returns an Application object.

InitialFilename Required Variant. File name to start with.

Filter Optional Variant. If supplied, just use one filter.

Title Optional Variant. Title of dialog box.

ButtonText Optional Variant. Text for OK button.

Return Value

String. File name.


GetSubjectLink Method

Returns a graphic that is linked to this one.

Syntax

expression.GetSubjectLink(VertexIndex, LinkIndex)

expression Required. An expression that returns a Graphic object.

VertexIndex Required Variant. The index or Vertex object to search.

LinkIndex Optional Variant. The link to get.

Return Value

Graphic. The linked Graphic object.


GraphicFromID Method

Finds the Graphic object in the collection with the given ID.

Syntax 1

expression.GraphicFromID(ID)

expression Required. An expression that returns a Graphics object.

ID Required Long. ID of Graphic object.

Syntax 2

expression.GraphicFromID(ID)

expression Required. An expression that returns a GraphicSet object.

ID Required Long. ID of Graphic object.

Syntax 3

expression.GraphicFromID(ID)

expression Required. An expression that returns a Layer object.

ID Required Long. ID of Graphic object.

Syntax 4

expression.GraphicFromID(ID)

expression Required. An expression that returns a Selection object.

ID Required Long. ID of Graphic object.

Return Value

Graphic. The Graphic object.


Help Method

Displays a Help topic.

Syntax

expression.Help(HelpFile, HelpContextID)

expression Required. An expression that returns an Application object.

HelpFile Optional Variant. The name of a help file.

HelpContextID Optional Variant. A help context id.


Identity Method

Sets the Matrix object to an identity matrix.

Syntax

expression.Identity

expression Required. An expression that returns a Matrix object.


Inflate Method

Enlarges or shrinks the size of the BoundingBox.

Remarks

The X, Y and Z coordinates of the Min and Max vertices will be adjusted by this amount.

Syntax

expression.Inflate(InflateBy)

expression Required. An expression that returns a BoundingBox object.

InflateBy Required Double. The amount to enlarge (positive value) or shrink (negative value) the BoundingBox by.


InvalidateObject Method

Repaint the Drawing object in this View object.

Syntax

expression.InvalidateObject(Object)

expression Required. An expression that returns a View object.

Object Required Object. The Drawing object.


InvalidateScreenRect Method

Invalidates the part of the View object specified by the parameters.

Remarks

This method does not work for built-in TurboCAD views (i.e. View objects representing TurboCAD's drawing window).

For custom Views this method allows you to refresh only the invalidated area of the drawing if the AutoRedraw property of the View object has been set to False. Otherwise the whole drawing will be redrawn.

Syntax

expression.InvalidateScreenRect(Left, Top, Width, Height)

expression Required. An expression that returns a View object.

Left Required Double. The x coordinate of the left hand side of the View object's view space.

Top Required Double. The y coordinate of the top of the View object's view space.

Width Required Double. The width in the View object's view space.

Height Required Double. The height in the View object's view space.


InvalidateViewRect Method

This method causes the View object to redraw the entire View on Refresh.

Remarks

This method does not work for built-in TurboCAD views (i.e. View objects representing TurboCAD's drawing window).

For custom Views this method allows you to refresh only the invalidated area of the drawing if the AutoRedraw property of the View object has been set to False. Otherwise the whole drawing will be redrawn.

Syntax

expression.InvalidateViewRect(Left, Top, Width, Height)

expression Required. An expression that returns a View object.

Left Required Double. The x coordinate of the left hand side of the View object's view space.

Top Required Double. The y coordinate of the top of the View object's view space.

Width Required Double. The width in the View object's view space.

Height Required Double. The height in the View object's view space.


Invert Method

Inverts the Matrix object.

Syntax

expression.Invert

expression Required. An expression that returns a Matrix object.


IsEqual Method

Returns True if the matrix entries are equal, otherwise returns False.

Syntax

expression.IsEqual(pIDisp)

expression Required. An expression that returns a Matrix object.

pIDisp Required Object. Matrix object.

Return Value

Boolean. True if equal, False if not equal.


MessageBox Method

Display a warning or notification message.

Syntax

expression.MessageBox(Message, Flags)

expression Required. An expression that returns an Application object.

Message Required String. Message string

Flags Required Variant. MB_ flags for API ::MessageBox call

Return Value

Long. Id of button that dismissed the dialog


MoveAbsolute Method

Moves the Graphic object(s) to a new location.

Syntax 1

expression.MoveAbsolute(X, Y, Z, XRef, YRef, ZRef)

expression Required. An expression that returns a Graphic object.

X Required Double. X coordinate to move to.

Y Required Double. Y coordinate to move to.

Z Required Double. Z coordinate to move to.

XRef Required Variant. X coordinate of the reference point.

YRef Optional Variant. Y coordinate of the reference point.

ZRef Optional Variant. Z coordinate of the reference point.

Return Value

Matrix. The matrix that was calculated.

Syntax 2

expression.MoveAbsolute(X, Y, Z, XRef, YRef, ZRef)

expression Required. An expression that returns a Graphics object.

X Required Double. X coordinate to move to.

Y Required Double. Y coordinate to move to.

Z Required Double. Z coordinate to move to.

XRef Required Variant. X coordinate of the reference point.

YRef Optional Variant. Y coordinate of the reference point.

ZRef Optional Variant. Z coordinate of the reference point.

Return Value

Matrix. The matrix that was calculated.


MoveRelative Method

Moves the Graphic object(s) by a specified offset.

Syntax 1

expression.MoveRelative(X, Y, Z)

expression Required. An expression that returns a Graphic object.

X Required Double. X offset.

Y Required Double. Y offset.

Z Required Double. Z offset.

Return Value

Matrix. The matrix that was calculated.

Syntax 2

expression.MoveRelative(X, Y, Z)

expression Required. An expression that returns a Graphics object.

X Required Double. X offset.

Y Required Double. Y offset.

Z Required Double. Z offset.

Return Value

Matrix. The matrix that was calculated.


Open Method

Opens a previously saved Drawing object.

Syntax

expression.Open(Filename, ReadOnly, Filter)

expression Required. An expression that returns a Drawings object.

Filename Required String. Name of file to open.

ReadOnly Required Variant. True if opened Drawing object should not be modified.

Filter Optional Variant. Name or index of preferred file filter.

Return Value

Drawing. The opened Drawing object.


OpenBitmapDC Method

Opens a DC for bitmap drawing.

Syntax

expression.OpenBitmapDC

expression Required. An expression that returns a View object.

Return Value

Long. The bitmap DC.


OpenMetafileDC Method

Opens a DC for metafile drawing.

Syntax

expression.OpenMetafileDC

expression Required. An expression that returns a View object.

Return Value

Long. The metafile DC.


Orbit Method

Orbits the Camera object about the point of interest.

Syntax

expression.Orbit(Angle, CameraCoordinates, XOrRight, YOrUp, ZOrDirection)

expression Required. An expression that returns a Camera object.

Angle Required Double. The rotation angle in radians.

CameraCoordinates Optional Variant. True to use camera's coordinate system.

XOrRight Optional Variant. The x or right coordinate of the rotation axis.

YOrUp Optional Variant. The y or up coordinate of the rotation axis.

ZOrDirection Optional Variant. The z or direction coordinate of the rotation axis.


Pan Method

Tilts the Camera object left or right.

Syntax

expression.Pan(AngleRight)

expression Required. An expression that returns a Camera object.

AngleRight Required Double. The angle to tilt to the right in radians.


PickInteractive Method

Begins an interactive pick by rectangle.

Syntax

expression.PickInteractive(Type, TopLevel, Arcs, Text, Segments, Blocks, Invisible)

expression Required. An expression that returns a Drawing object.

Type Required ImsiPickType. Point (0), rect (1) or polygon (2) pick.

TopLevel Required Variant. True if only top level Graphic object's are to be picked.

Arcs Optional Variant. True if arcs should be returned in pick.

Text Optional Variant. True if text should be returned in pick.

Segments Optional Variant. True if only segments should be returned in pick.

Blocks Optional Variant. True if segments in blocks should be returned in pick.

Invisible Optional Variant. True if invisible segements can be picked.

Return Value

PickResult. The result of the pick


PickPoint Method

Pick the Graphic objects at a point in the view coordinate system.

Syntax

expression.PickPoint(X, Y, Aperture, TopLevel, Arcs, Text, Segments, Blocks, Invisible)

expression Required. An expression that returns a View object.

X Required Double. X coordinate of point in view coordinate system.

Y Required Double. Y coordinate of point in view coordinate system.

Aperture Required Variant. Size of aperture in pixels.

TopLevel Optional Variant. True if only top level Graphic object's are to be picked.

Arcs Optional Variant. True if arcs should be returned in pick.

Text Optional Variant. True if text should be returned in pick.

Segments Optional Variant. True if only segments should be returned in pick.

Blocks Optional Variant. True if segments in blocks should be returned in pick.

Invisible Optional Variant. True if invisible segements can be picked.

Return Value

PickResult. The sorted results of the pick operation.


PickRect Method

Pick Graphic objects within a rectangle in the view coordinate system.

Syntax

expression.PickRect(Left, Top, Right, Bottom, TopLevel, Arcs, Text, Segments, Blocks, Invisible)

expression Required. An expression that returns a View object.

Left Required Double. X coordinate of left side of rectangle in the view coordinate system.

Top Required Double. Y coordinate of top of rectangle in the view coordinate system.

Right Required Double. X coordinate of right side of rectangle in the view coordinate system.

Bottom Required Double. Y coordinate of bottom of rectangle in the view coordinate system.

TopLevel Required Variant. True if only top level Graphic object's are to be picked.

Arcs Optional Variant. True if arcs should be returned in pick.

Text Optional Variant. True if text should be returned in pick.

Segments Optional Variant. True if only segments should be returned in pick.

Blocks Optional Variant. True if segments in blocks should be returned in pick.

Invisible Optional Variant. True if invisible segements can be picked.

Return Value

PickResult. The sorted results of the pick operation.


PopGraphicDefaults Method

Restores the properties of the Graphic object that will be used as a template for all Graphics.Add calls.

Remarks

Invoke this method to balance a previous call to PushGraphicDefaults.

Syntax

expression.PopGraphicDefaults(PrevDefaults)

expression Required. An expression that returns an Application object.

PrevDefaults Optional Variant. The previous default level to restore to.


PopVertexDefaults Method

Restores the properties of the Vertex object that will be used as a template for all Vertices.Add calls. Invoke this method to balance a previous call to PushVertexDefaults.

Syntax

expression.PopVertexDefaults(PrevDefaults)

expression Required. An expression that returns an Application object.

PrevDefaults Optional Variant. The previous default level to restore to.


PushGraphicDefaults Method

Sets the properties of the Graphic object that will be used as a template for all Graphics.Add calls. Modifies the existing template according to the optional parameters passed. Restore the existing template by invoking PopGraphicDefaults.

Syntax

expression.PushGraphicDefaults(Editable, Visible, Cosmetic, Unbounded)

expression Required. An expression that returns an Application object.

Editable Required Variant. True if the Graphic object can be moved or deleted.

Visible Optional Variant. True if the Graphic object is visible.

Cosmetic Optional Variant. True if the Graphic object is not part of the main graphic.

Unbounded Optional Variant. True if the Graphic object is unbounded.

Return Value

Long. The new default level.


PushVertexDefaults Method

Sets the properties of the Vertex object that will be used as a template for all Vertices.Add calls. Modifies the existing template according to the optional parameters passed. Restore the existing template by invoking PopVertexDefaults.

Syntax

expression.PushVertexDefaults(PenDown, Selectable, Snappable, Editable, Linkable, Calculated)

expression Required. An expression that returns an Application object.

PenDown Required Variant. True if the Vertex object should draw.

Selectable Optional Variant. True if the Vertex object can be selected.

Snappable Optional Variant. True if the Vertex object can be snapped to.

Editable Optional Variant. True if the Vertex object can be moved or deleted.

Linkable Optional Variant. True if the Vertex object can be linked to.

Calculated Optional Variant. True if the Vertex object is recalculated by the RegenMethod.

Return Value

Long. The new default level.


QuerySet Method

Returns the Graphic objects in the collection that match a query string.

Syntax 1

expression.QuerySet(Query)

expression Required. An expression that returns a Graphics object.

Query Required String. The query string.

Return Value

GraphicSet. The matching Graphic objects, as a GraphicSet Object.

Syntax 2

expression.QuerySet(Query)

expression Required. An expression that returns a Layer object.

Query Required String. The query string.

Return Value

GraphicSet. The matching Graphic objects, as a GraphicSet Object.


Quit Method

Quits the application. Does not run any OnClose macros before exiting.

Syntax

expression.Quit

expression Required. An expression that returns an Application object.


Redo Method

Redoes the last user interface action.

Syntax 1

expression.Redo(Times)

expression Required. An expression that returns a Application object.

Times Required Variant. Number of actions to redo.

Return Value

Boolean. True if the redo was successful.

Syntax 2

expression.Redo(Times)

expression Required. An expression that returns a Drawing object.

Times Required Variant. Number of actions to redo.

Return Value

Boolean. True if the redo was successful.


Refresh Method

Repaint the Drawing object in the specified View object or in all the Views.

Syntax 1

expression.Refresh

expression Required. An expression that returns a View object.

Syntax 2

expression.Refresh

expression Required. An expression that returns a Views object.


RegenLock Method

Acquires a lock for the Regen method of a custom Regen object .

Remarks

You need to use this lock to prevent recursive calling of the object server's Regen method. Updates made in the Regen method can cause additional calls to the Regen method. Use RegenUnlock to unlock the lock when finished.

Syntax

expression.RegenLock

expression Required. An expression that returns a Graphic object.

Return Value

Long. Previous value of lock count.


RegenUnlock Method

Releases a lock for the Regen method of a custom Regen object .

Remarks

You need to use this lock to prevent recursive calling of the object server's Regen method. Updates made in the Regen method can cause additional calls to the Regen method. Use RegenLock to first lock the regen.

Syntax

expression.RegenUnlock(LockCount)

expression Required. An expression that returns a Graphic object.

LockCount Optional Variant. Lock count to reset to.


Remove Method

Removes an item from the collection.

Syntax 1

expression.Remove(Index)

expression Required. An expression that returns a Graphics object.

Index Required Variant. The index of item to be removed.

Return Value

Graphic. The Graphic object that was removed.

Syntax 2

expression.Remove(Index)

expression Required. An expression that returns a GraphicSet object.

Index Required Variant. The index of item to be removed.

Return Value

Graphic. The Graphic object that was removed.

Syntax 3

expression.Remove(Index)

expression Required. An expression that returns a Layer object.

Index Required Variant. The index of item to be removed.

Return Value

Graphic. The Graphic object that was removed.

Syntax 4

expression.Remove(Index)

expression Required. An expression that returns a Selection object.

Index Required Variant. The index of item to be removed.

Return Value

Graphic. The Graphic object that was removed.

Syntax 5

expression.Remove(Index)

expression Required. An expression that returns a Vertices object.

Index Required Variant. The index of item to be removed.

Return Value

Vertex. The Vertex object that was removed.


RenderScenesGraphicsUpdate Method

Updates the Graphics in the rendered scene.

Syntax

expression.RenderScenesGraphicsUpdate(pDisp, flag)

expression Required. An expression that returns a Drawing object.

pDisp Required Object. The Graphic object.

flag Required 0 means insert the Graphic, 1 means delete the Graphic and 2 means change the Graphic.


RenderScenesUpdateChanges Method

Updates the changes in the rendered scene.

Syntax

expression.RenderScenesUpdateChanges

expression Required. An expression that returns a Drawing object.


Rotate Method

Rotates the Camera object about an arbitrary axis.

Syntax 1

expression.Rotate(Angle, CameraCoordinates, XOrRight, YOrUp, ZOrDirection)

expression Required. An expression that returns a Camera object.

Angle Required Double. The rotation angle in radians.

CameraCoordinates Optional Variant. True to use camera's coordinate system.

XOrRight Optional Variant. The x or right coordinate of the rotation axis.

YOrUp Optional Variant. The y or up coordinate of the rotation axis.

ZOrDirection Optional Variant. The z or direction coordinate of the rotation axis.

Syntax 2

expression.Rotate(XAxis, YAxis, ZAxis, Angle, XCenter, YCenter, ZCenter, Concat)

expression Required. An expression that returns a Matrix object.

XAxis Required Double. The x coordinate of the rotation axis.

YAxis Required Double. The y coordinate of the rotation axis.

ZAxis Required Double. The z coordinate of the rotation axis.

Angle Required Double. The rotation angle in radians.

XCenter Optional Variant. The x coordinate of the center of rotation.

YCenter Optional Variant. The y coordinate of the center of rotation.

ZCenter Optional Variant. The z coordinate of the center of rotation.

Concat Optional Variant. True to concatenate this to the existing transform.


RotateAbsolute Method

Rotates the Graphic objects in the collection.

Syntax 1

expression.RotateAbsolute(XTo, YTo, ZTo, XFrom, YFrom, ZFrom, XRef, YRef, ZRef)

expression Required. An expression that returns a Graphic object.

XTo Required Variant. X coordinate of the point to rotate to.

YTo Required Variant. Y coordinate of the point to rotate to.

ZTo Required Variant. Z coordinate of the point to rotate to.

XFrom Required Variant. X coordinate of the point to rotate from.

YFrom Required Variant. Y coordinate of the point to rotate from.

ZFrom Required Variant. Z coordinate of the point to rotate from.

XRef Required Variant. X coordinate of the rotation center.

YRef Optional Variant. Y coordinate of the rotation center.

ZRef Optional Variant. Z coordinate of the rotation center.

Return Value

Matrix. The matrix that was calculated.

Syntax 2

expression.RotateAbsolute(XTo, YTo, ZTo, XFrom, YFrom, ZFrom, XRef, YRef, ZRef)

expression Required. An expression that returns a Graphics object.

XTo Required Variant. X coordinate of the point to rotate to.

YTo Required Variant. Y coordinate of the point to rotate to.

ZTo Required Variant. Z coordinate of the point to rotate to.

XFrom Required Variant. X coordinate of the point to rotate from.

YFrom Required Variant. Y coordinate of the point to rotate from.

ZFrom Required Variant. Z coordinate of the point to rotate from.

XRef Required Variant. X coordinate of the rotation center.

YRef Optional Variant. Y coordinate of the rotation center.

ZRef Optional Variant. Z coordinate of the rotation center.

Return Value

Matrix. The matrix that was calculated.


RotateAxis Method

Rotates the Graphic object or objects in the collection.

Syntax 1

expression.RotateAxis(Angle, XAxis, YAxis, ZAxis, X, Y, Z)

expression Required. An expression that returns a Graphic object.

Angle Required Double. Angle of rotation in radians.

XAxis Required Variant. X coordinate of axis direction.

YAxis Optional Variant. Y coordinate of axis direction.

ZAxis Optional Variant. Z coordinate of axis direction.

X Optional Variant. X coordinate of the rotation center.

Y Optional Variant. Y coordinate of the rotation center.

Z Optional Variant. Z coordinate of the rotation center.

Return Value

Matrix. The matrix that was calculated.

Syntax 1

expression.RotateAxis(Angle, XAxis, YAxis, ZAxis, X, Y, Z)

expression Required. An expression that returns a Graphics object.

Angle Required Double. Angle of rotation in radians.

XAxis Required Variant. X coordinate of axis direction.

YAxis Optional Variant. Y coordinate of axis direction.

ZAxis Optional Variant. Z coordinate of axis direction.

X Optional Variant. X coordinate of the rotation center.

Y Optional Variant. Y coordinate of the rotation center.

Z Optional Variant. Z coordinate of the rotation center.

Return Value

Matrix. The matrix that was calculated.


RotateDragOutline Method

Rotate the drag outline by the specified paramters.

Syntax

expression.RotateDragOutline(Coords, Angle, DragState)

expression Required. An expression that returns a View object.

Coords Required Variant. Array of (X, Y, Z) polygon coordinates.

Angle Required Double. Angle of rotation in radians, counterclockwise positive.

DragState Optional Variant. Continue or end of drag operation


Run Method

Starts a 3D rendering job.

Remarks

You can also use the RenderView.BeginRender method to start a 3D rendering job.

Syntax

expression.Run(pView)

expression Required. An expression that returns a Render object.

pView Required View object. A View object where rendered object will be displayed.

Return Value

Currently, no return value is returned (defect).


RunTurboLISP Method

Interprets and executes a TurboLISP expression.

Syntax

expression.RunTurboLISP(Expression)

expression Required. An expression that returns an Application object.

Expression Required String.Tthe LISP expression as a string

Return Value

String.The result as a string.


Save Method

Saves changes to the specified Drawing object.

Syntax

expression.Save

expression Required. An expression that returns a Drawing object.


SaveAs Method

Saves the changes to the Drawing object in a different file. If a Selection object is used, SaveAs will save the selection to the file specified.

Syntax 1

expression.SaveAs(Filename, Filter)

expression Required. An expression that returns a Drawing object.

Filename Required String. The file name to save to.

Filter Optional Variant. Name or index of preferred filter.

Syntax 2

expression.SaveAs(Filename, Filter)

expression Required. An expression that returns a Selection object.

Filename Required String. The file name to save to.

Filter Optional Variant. Name or index of preferred filter.


SaveCopyAs Method

Saves a copy of the Drawing object to a file but does not modify the open Drawing object.

Syntax

expression.SaveCopyAs(Filename, Filter)

expression Required. An expression that returns a Drawing object.

Filename Required String. File name to save to.

Filter Optional Variant. Name or index of preferred filter.


Scale Method

Scales the Graphic or Graphic objects in the collection.

Syntax 1

expression.Scale(XScale, YScale, ZScale, XRef, YRef, ZRef)

expression Required. An expression that returns a Graphic object.

XScale Required Double. X scale factor.

YScale Required Double. Y scale factor.

ZScale Required Double. Z scale factor.

XRef Required Variant. X coordinate of the reference point.

YRef Optional Variant. Y coordinate of the reference point.

ZRef Optional Variant. Z coordinate of the reference point.

Return Value

Matrix. The matrix that was calculated.

Syntax 2

expression.Scale(XScale, YScale, ZScale, XRef, YRef, ZRef)

expression Required. An expression that returns a Graphics object.

XScale Required Double. X scale factor.

YScale Required Double. Y scale factor.

ZScale Required Double. Z scale factor.

XRef Required Variant. X coordinate of the reference point.

YRef Optional Variant. Y coordinate of the reference point.

ZRef Optional Variant. Z coordinate of the reference point.

Return Value

Matrix. The matrix that was calculated.

Syntax 3

expression.Scale(XScale, YScale, ZScale, XCenter, YCenter, ZCenter, Concat)

expression Required. An expression that returns a Matrix object.

XScale Required Double. The x scale factor.

YScale Required Double. The y scale factor.

ZScale Required Double. The z scale factor.

XCenter Optional Variant. The x coordinate of the center of scaling.

YCenter Optional Variant. The y coordinate of the center of scaling.

ZCenter Optional Variant. The z coordinate of the center of scaling.

Concat Optional Variant. True to concatenate this to the existing transform.


ScreenToView Method

Transforms (2D) coordinates from screen space to view space.

Syntax

expression.ScreenToView(XScreen, YScreen, XView, YView)

expression Required. An expression that returns a View object.

XScreen Required Double. X coordinate in screen space.

YScreen Required Double. Y coordinate in screen space.

XView Required Double. X coordinate in view space.

YView Required Double. Y coordinate in view space.


Select Method

Selects all the Graphic object's in the collection.

Syntax 1

expression.Select

expression Required. An expression that returns a Graphic object.

Syntax 1

expression.Select

expression Required. An expression that returns a Graphics object.

Syntax 1

expression.Select

expression Required. An expression that returns a GraphicSet object.

Syntax 1

expression.Select

expression Required. An expression that returns a Layer object.

Syntax 1

expression.Select

expression Required. An expression that returns a Selection object.


SelectAll Method

If called with a PaperSpace object, this method selects all of the Graphic objects in the PaperSpace object's Graphics collection. Has the same effect as PaperSpace.Graphics.Select.

If called with a Drawing object, this method selects all of the Graphic objects in the Drawing object's Graphics collection. Has the same effect as Drawing.Graphics.Select.

Syntax 1

expression.SelectAll

expression Required. An expression that returns a Drawing object.

Syntax 2

expression.SelectAll

expression Required. An expression that returns a PaperSpace object.


SendToBack Method

Sends the Graphic object to the back.

Syntax

expression.SendToBack

expression Required. An expression that returns a Graphic object.


Set Method

Sets the BoundingBox object to a point or cube around a specified vertex.

Syntax

expression.Set(Center, Size)

expression Required. An expression that returns a BoundingBox object.

Center Optional Variant. A Vertex object specifying the center of the BoundingBox object.

Size Optional Variant. The size of the BoundingBox object.


SetArray Method

Sets the Matrix object from an array with the values of a 4x4 matrix.

Syntax

expression.SetArray(ArrayEntries)

expression Required. An expression that returns a Matrix object.

ArrayEntries Required Variant. An array of 16 doubles.


SetEntries Method

Set the all entries in the Matrix object.

Syntax

expression.SetEntries(e00, e01, e02, e03, e10, e11, e12, e13, e20, e21, e22, e23, e30, e31, e32, e33)

expression Required. An expression that returns a Matrix object.

e00 Required Double. The entry value.

e01 Required Double. The entry value.

e02 Required Double. The entry value.

e03 Required Double. The entry value.

e10 Required Double. The entry value.

e11 Required Double. The entry value.

e12 Required Double. The entry value.

e13 Required Double. The entry value.

e20 Required Double. The entry value.

e21 Required Double. The entry value.

e22 Required Double. The entry value.

e23 Required Double. The entry value.

e30 Required Double. The entry value.

e31 Required Double. The entry value.

e32 Required Double. The entry value.

e33 Required Double. The entry value.


SetEntry Method

Set the Matrix object's entry 'e' at the index 'i' (row) and 'j' (column).

Syntax

expression.SetEntry(i, j, e)

expression Required. An expression that returns a Matrix object.

i Required Long. The x scale factor.

j Required Long. The y scale factor.

e Required Double. New entry value.


SetForAll Method

Sets the specific property for all graphics in the set.

Syntax

expression.SetForAll(PropertyName, prop)

expression Required. An expression that returns a GraphicSet object.

PropertyName Required Variant. The name of property to set.

prop Required Variant. The Property value.


SetItem Method

Sets an item in the BrushPattern object.

Syntax

expression.SetItem(Index, Dashes, XOrigin, YOrigin, Width, Height, Angle)

expression Required. An expression that returns a BrushPattern object.

Index Required Long. Index of item to set.

Dashes Required Variant. The line style.

XOrigin Required Double. The x coordinate of the pattern's origin.

YOrigin Required Double. The y coordinate of the pattern's origin.

Width Required Double. The width (x axis) of the pattern's origin.

Height Required Double. The height (y axis) of the pattern's origin.

Angle Required Double. The angle of the line in radians.


Slide Method

Slides the Camera object perpendicular to its direction vector.

Syntax

expression.Slide(DistanceUp, DistanceRight)

expression Required. An expression that returns a Camera object.

DistanceUp Required Double. The distance to slide in the up direction.

DistanceRight Required Double. The distance to slide in the right direction.


TextSet Method

Set the start point, height, width, and angle for a text graphic object.

Syntax

expression.TextSet(Text, X, Y, Z, Width, Height, Angle)

expression Required. An expression that returns a Graphic object.

Text Optional Variant. The text string

X Optional Variant. X coordinate of text point.

Y Optional Variant. Y coordinate of text point.

Z Optional Variant. Z coordinate of text point.

Width Optional Variant. Width of object.

Height Optional Variant. Height of object.

Angle Optional Variant. Rotation angle of object in radians.


Tilt Method

Tilts the Camera object up or down.

Syntax

expression.Tilt(AngleUp)

expression Required. An expression that returns a Camera object.

AngleUp Required Double. The angle to tilt up in radians.


Track Method

Moves the Camera object along its direction vector.

Syntax

expression.Track(DistanceForward)

expression Required. An expression that returns a Camera object.

DistanceForward Required Double. The distance to move.


Transform Method

Transforms the Graphic or Graphic objects in the collection.

Syntax 1

expression.Transform(Transform)

expression Required. An expression that returns a Graphic object.

Transform Required Matrix. The matrix to perform transformation.

Syntax 2

expression.Transform(Transform)

expression Required. An expression that returns a Graphics object.

Transform Required Matrix. The matrix to perform transformation.


Translate Method

Sets the Matrix object to, or transforms the Matrix object by, a translation.

Syntax

expression.Translate(X, Y, Z, Concat)

expression Required. An expression that returns a Matrix object.

X Required Double. The x coordinate of the translation.

Y Required Double. The y coordinate of the translation.

Z Required Double. The z coordinate of the translation.

Concat Optional Variant. True to concatenate this to the existing transform.


TranslateScaleAndRotateZ Method

Translates, scales, and rotates around z axis.

Syntax

expression.TranslateScaleAndRotateZ(X, Y, Z, XScale, YScale, ZScale, Angle, XCenter, YCenter, ZCenter, Concat)

expression Required. An expression that returns a Matrix object.

X Required Double. X coordinate of the translation.

Y Required Double. Y coordinate of the translation.

Z Required Double. Z coordinate of the translation.

XScale Required Double. X scale factor.

YScale Required Double. Y scale factor.

ZScale Required Double. Z scale factor.

Angle Required Double. Angle of rotation around z axis in radians.

XCenter Optional Variant. The x coordinate of the center of rotation.

YCenter Optional Variant. The y coordinate of the center of rotation.

ZCenter Optional Variant. The z coordinate of the center of rotation.

Concat Optional Variant. True to concatenate this to the existing transform.


Transpose Method

Transposes the Matrix object.

Syntax

expression.Transpose

expression Required. An expression that returns a Matrix object.


Undo Method

Cancels the last user interface action.

Syntax 1

expression.Undo(Times)

expression Required. An expression that returns an Application object.

Times Required Variant. Number of actions to undo.

Return Value

Boolean. True if the Undo was successful.

Syntax 2

expression.Undo(Times)

expression Required. An expression that returns an Drawing object.

Times Required Variant. Number of actions to undo.

Return Value

Boolean. True if the Undo was successful.


UndoClear Method

Clears all the Drawing object's undo entries.

Syntax

expression.UndoClear

expression Required. An expression that returns a Drawing object.


Unselect Method

Unselects all the Graphic object's in the collection.

Syntax 1

expression.Unselect

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.Unselect

expression Required. An expression that returns a Graphics object.

Syntax 3

expression.Unselect

expression Required. An expression that returns a GraphicSet object.

Syntax 4

expression.Unselect

expression Required. An expression that returns a Layer object.

Syntax 5

expression.Unselect

expression Required. An expression that returns a Selection object.


UnselectAll Method

If called with a PaperSpace object, this method unselects all of the Graphic objects in the PaperSpace object's Graphics collection. Has the same effect as PaperSpace.Graphics.Unselect.

If called with a Drawing object, this method unselects all of the Graphic objects in the Drawing object's Graphics collection. Has the same effect as Drawing.Graphics.Unselect.

Syntax 1

expression.UnselectAll

expression Required. An expression that returns a Drawing object.

Syntax 2

expression.UnselectAll

expression Required. An expression that returns a PaperSpace object.


Update Method

Forces an update of the Graphic object's properties.

Syntax

expression.Update

expression Required. An expression that returns a Graphic object.


ViewToScreen Method

Transforms (2D) coordinates from view space to screen space.

Syntax

expression.ViewToScreen(XView, YView, XScreen, YScreen)

expression Required. An expression that returns a View object.

XView Required Double. X coordinate in view space.

YView Required Double. Y coordinate in view space.

XScreen Required Double. X coordinate in screen space.

YScreen Required Double. Y coordinate in screen space.

Return Value

Boolean. TRUE if transformed point is within Screen rectangle.


ViewToWorld Method

Transforms (3D) coordinates from view CS to world CS.

Syntax

expression.ViewToWorld(XView, YView, ZView, XWorld, YWorld, ZWorld)

expression Required. An expression that returns a View object.

XView Required Double. X coordinate in view space.

YView Required Double. Y coordinate in view space.

ZView Required Double. Y coordinate in view space.

XWorld Required Double. X coordinate in screen space.

YWorld Required Double. Y coordinate in screen space.

ZWorld Required Double. Z coordinate in screen space.


WorldToView Method

Transforms (3D) coordinates from world CS to view CS.

Syntax

expression.WorldToView(XWorld, YWorld, ZWorld, XView, YView, ZView)

expression Required. An expression that returns a View object.

XWorld Required Double. X coordinate in screen space.

YWorld Required Double. Y coordinate in screen space.

ZWorld Required Double. Z coordinate in screen space.

XView Required Double. X coordinate in view space.

YView Required Double. Y coordinate in view space.

ZView Required Double. Z coordinate in view space.


Zoom Method

Zooms the focal length of the Camera object.

Syntax

expression.Zoom(ZoomFactor)

expression Required. An expression that returns a Camera object.

ZoomFactor Required Double. The amount of zoom.


ZoomToExtents Method

Set the View object's extents to those of the drawing.

Syntax

expression.ZoomToExtents

expression Required. An expression that returns a View object.


ZoomToNamedView Method

Zooms the View object to a NamedView object

Syntax

expression.ZoomToNamedView(NamedView)

expression Required. An expression that returns a View object.

NamedView Required Variant. NamedView object.


Active Property

Returns True if object is active otherwise returns False.

Syntax 1

expression.Active

expression Required. An expression that returns a PaperSpace object.

Syntax 2

expression.Active

expression Required. An expression that returns a Tool object.


ActiveDrawing Property

Returns the active Drawing object.

Syntax 1

ActiveDrawing

Syntax 2

expression.ActiveDrawing

expression Required. An expression that returns a Application object.


ActiveView Property

Returns the active View object.

Syntax

expression.ActiveView

expression Required. An expression that returns a Drawing object.


Anchor Property

Returns the anchor point for insertions.

Syntax

expression.Anchor

expression Required. An expression that returns a Block object.


Application Property

Returns an Application object that represents the owner of the specified object.

Syntax 1

Application

Syntax 2

expression.Application

expression Required. An expression that returns a Application object.

Syntax 3

expression.Application

expression Required. An expression that returns a Block object.

Syntax 4

expression.Application

expression Required. An expression that returns a Blocks object.

Syntax 5

expression.Application

expression Required. An expression that returns a BrushPatterns object.

Syntax 6

expression.Application

expression Required. An expression that returns a BrushStyle object.

Syntax 7

expression.Application

expression Required. An expression that returns a BrushStyles object.

Syntax 8

expression.Application

expression Required. An expression that returns a Camera object.

Syntax 9

expression.Application

expression Required. An expression that returns a Drawing object.

Syntax 10

expression.Application

expression Required. An expression that returns a Drawings object.

Syntax 11

expression.Application

expression Required. An expression that returns a Filter object.

Syntax 12

expression.Application

expression Required. An expression that returns a Filters object.

Syntax 13

expression.Application

expression Required. An expression that returns a Graphic object.

Syntax 14

expression.Application

expression Required. An expression that returns a Graphics object.

Syntax 15

expression.Application

expression Required. An expression that returns a GraphicSet object.

Syntax 16

expression.Application

expression Required. An expression that returns a GraphicSets object.

Syntax 17

expression.Application

expression Required. An expression that returns a Layer object.

Syntax 18

expression.Application

expression Required. An expression that returns a Layers object.

Syntax 19

expression.Application

expression Required. An expression that returns a LineStyle object.

Syntax 20

expression.Application

expression Required. An expression that returns a LineStyles object.

Syntax 21

expression.Application

expression Required. An expression that returns a Macro object.

Syntax 22

expression.Application

expression Required. An expression that returns a Macros object.

Syntax 23

expression.Application

expression Required. An expression that returns a NamedColor object.

Syntax 24

expression.Application

expression Required. An expression that returns a NamedColors object.

Syntax 25

expression.Application

expression Required. An expression that returns a NamedView object.

Syntax 26

expression.Application

expression Required. An expression that returns a NamedViews object.

Syntax 27

expression.Application

expression Required. An expression that returns a PaperSpace object.

Syntax 28

expression.Application

expression Required. An expression that returns a PaperSpaces object.

Syntax 29

expression.Application

expression Required. An expression that returns a PickEntry object.

Syntax 30

expression.Application

expression Required. An expression that returns a PickResult object.

Syntax 31

expression.Application

expression Required. An expression that returns a Property object.

Syntax 32

expression.Application

expression Required. An expression that returns a Properties object.

Syntax 33

expression.Application

expression Required. An expression that returns a RegenMethod object.

Syntax 34

expression.Application

expression Required. An expression that returns a RegenMethods object.

Syntax 35

expression.Application

expression Required. An expression that returns a Render object.

Syntax 36

expression.Application

expression Required. An expression that returns a Renders object.

Syntax 37

expression.Application

expression Required. An expression that returns a RenderView object.

Syntax 38

expression.Application

expression Required. An expression that returns a Selection object.

Syntax 39

expression.Application

expression Required. An expression that returns a Tie object.

Syntax 40

expression.Application

expression Required. An expression that returns a TieMethod object.

Syntax 41

expression.Application

expression Required. An expression that returns a TieMethods object.

Syntax 42

expression.Application

expression Required. An expression that returns a TieSet object.

Syntax 43

expression.Application

expression Required. An expression that returns a TieSets object.

Syntax 44

expression.Application

expression Required. An expression that returns a Tool object.

Syntax 45

expression.Application

expression Required. An expression that returns a Tools object.

Syntax 46

expression.Application

expression Required. An expression that returns a UndoRecord object.

Syntax 47

expression.Application

expression Required. An expression that returns a Vertices object.

Syntax 48

expression.Application

expression Required. An expression that returns a View object.

Syntax 49

expression.Application

expression Required. An expression that returns a Views object.


Attributes Property

Returns the Graphic object's Attributes collection.

Syntax

expression.Attributes

expression Required. An expression that returns a Graphic object.


AutoRedraw Property

You can control when custom views redraw (views created with Views.Add method). If AutoRedraw is set to False the Refresh method will not redraw the view.

Syntax

expression.AutoRedraw

expression Required. An expression that returns a View object.


Block Property

Returns the Block object referenced by a block insertion.

Syntax

expression.Block

expression Required. An expression that returns a Graphic object.


Blocks Property

Returns the Drawing object's Blocks collection.

Syntax

expression.Blocks

expression Required. An expression that returns a Drawing object.


Blue Property

Returns the blue value of the color.

Syntax

expression.Blue

expression Required. An expression that returns a NamedColor object.


BottomMargin Property

Sets the size of the bottom margin, in millimeters.

Syntax

expression.BottomMargin

expression Required. An expression that returns a PageSetup object.


BoundingBox Property

Returns the NamedView object's BoundingBox object.

Syntax

expression.BoundingBox

expression Required. An expression that returns a NamedView object.


Brightness Property

Sets the brightness value of the color.

Syntax

expression.Brightness

expression Required. An expression that returns a NamedColor object.


BrushStyle Property

Returns the Graphic or Layer object's brush style.

Syntax 1

expression.BrushStyle

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.BrushStyle

expression Required. An expression that returns a Layer object.


BrushStyles Property

Returns the Drawing object's BrushStyles collection.

Syntax

expression.BrushStyles

expression Required. An expression that returns a Drawing object.


Build Property

Read only. Returns the build number as a string.

Syntax

expression.Build(lcid)

expression Required. An expression that returns an Application object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Builtin Property

Returns True if the object is built-in (one of the TurboCAD basic subtypes).

Syntax 1

expression.Builtin

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.Builtin

expression Required. An expression that returns a Property object.


Bulge Property

A Boolean flag that signals whether the Vertex object contained by a polyline graphic is part of an arc segment definition.

Syntax

expression.Bulge

expression Required. An expression that returns a Vertex object.

Remarks

The Bulge flag is set to True only for vertices that define elliptical arc segments in 2D polyline graphics. The following picture shows a polyline that contains arc segments (bulge vertices are 2, 3, 5 and 6):

For more information on 2D polylines and the use of the Bulge property, see the In Depth section.


Calculated Property

A Boolean flag that indicates whether the Vertex object will be recalculated by the graphic that owns it.

Syntax

expression.Calculated

expression Required. An expression that returns a Vertex object.

Remarks

The coordinates of calculated vertices should only be modified by the regen method of the owning graphic. If you attempt to modify the location of a calculated vertex, the location information will probably remain as you set it only until the next update of the graphic.


Camera Property

Returns the camera that controls the View object.

Syntax

expression.Camera

expression Required. An expression that returns a View object.


Capability Property

The Capability property describes the capabilities of a file fiter. It can be one of three values: 0 (Read only) , 1 (Write only) and 2 (Read and Write).

Syntax

expression.Capability

expression Required. An expression that returns a Filter object.


Category Property

Sets or returns the name of the Tool object's category as a string.

Syntax

expression.Category(lcid)

expression Required. An expression that returns a Tool object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


CenterOnExtents Property

True if the View object's extents are centered within the Window.

Syntax

expression.CenterOnExtents

expression Required. An expression that returns a View object.


Closed Property

True if the Graphic object is a closed figure.

Syntax

expression.Closed

expression Required. An expression that returns a Graphic object.


ClosestChildGraphic Property

Returns the closest child Graphic object in the Graphic object.

Syntax

expression.ClosestChildGraphic

expression Required. An expression that returns a PickEntry object.


ClosestSegmentVertex Property

Returns the closest Vertex object on the closest segment of the entity.

Syntax

expression.ClosestSegmentVertex

expression Required. An expression that returns a PickEntry object.


ClosestVertex Property

Returns the closest point on the entity.

Syntax

expression.ClosestVertex

expression Required. An expression that returns a PickEntry object.


Color Property

RGB value of the color.

Syntax 1

expression.Color

expression Required. An expression that returns a NamedColor object.

Syntax 2

expression.Color

expression Required. An expression that returns a Layer object.


Columns Property

Sets the number of columns necessary to tile the sheet height.

Syntax

expression.Columns

expression Required. An expression that returns a PageSetup object.


CommandName Property

Returns or sets the name of the object as a string.

Syntax

expression.CommandName(lcid)

expression Required. An expression that returns a Tool object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Cosmetic Property

Returns true if the Graphic object is used for display regeneration only.

Remarks

Complex graphic objects use a regen method to create their visible representation. The temporary display graphics (e.g. the line segments in a vector hatch pattern) created by the regen method will have their Cosmetic property set to True.

Syntax

expression.Cosmetic

expression Required. An expression that returns a Graphic object.


Count Property

Returns the number of items in the collection. For the Layer and GraphicSet objects, returns the number of graphics on the layer or in the GraphicSet.

Syntax 1

expression.Count

expression Required. An expression that returns a Blocks object.

Syntax 2

expression.Count

expression Required. An expression that returns a BrushPatterns object.

Syntax 3

expression.Count

expression Required. An expression that returns a BrushStyles object.

Syntax 4

expression.Count

expression Required. An expression that returns a Drawings object.

Syntax 5

expression.Count

expression Required. An expression that returns a Filters object.

Syntax 6

expression.Count

expression Required. An expression that returns a Graphics object.

Syntax 7

expression.Count

expression Required. An expression that returns a GraphicSet object.

Syntax 8

expression.Count

expression Required. An expression that returns a GraphicSets object.

Syntax 9

expression.Count

expression Required. An expression that returns a Layer object.

Syntax 10

expression.Count

expression Required. An expression that returns a Layers object.

Syntax 11

expression.Count

expression Required. An expression that returns a LineStyles object.

Syntax 12

expression.Count

expression Required. An expression that returns a Macros object.

Syntax 13

expression.Count

expression Required. An expression that returns a NamedColors object.

Syntax 14

expression.Count

expression Required. An expression that returns a NamedViews object.

Syntax 15

expression.Count

expression Required. An expression that returns a PaperSpaces object.

Syntax 16

expression.Count

expression Required. An expression that returns a PickResult object.

Syntax 17

expression.Count

expression Required. An expression that returns a Properties object.

Syntax 18

expression.Count

expression Required. An expression that returns a RegenMethods object.

Syntax 19

expression.Count

expression Required. An expression that returns a Renders object.

Syntax 20

expression.Count

expression Required. An expression that returns a Selection object.

Syntax 21

expression.Count

expression Required. An expression that returns a TieMethods object.

Syntax 22

expression.Count

expression Required. An expression that returns a TieSet object.

Syntax 23

expression.Count

expression Required. An expression that returns a TieSets object.

Syntax 24

expression.Count

expression Required. An expression that returns a Tools object.

Syntax 25

expression.Count

expression Required. An expression that returns a Vertices object.

Syntax 26

expression.Count

expression Required. An expression that returns a Views object.


Data Property

Contains the data that maintains the geometrical state of the Tie as the subordinate and subject Graphics change.

Syntax

expression.Data

expression Required. An expression that returns a Tie object.


DC Property

Returns the DC associated with a View object.

Syntax

expression.DC

expression Required. An expression that returns a View object.


DefaultMode Property

Sets or returns the default rendering mode for the Render object.

Remarks

The possible values are:

imsiRenderModeFlat = 0
imsiRenderModeGouraud = 1
imsiRenderModePhong = 2
imsiRenderModePreview = 3
imsiRenderModeFull = 4
imsiRenderModeRtPreview = 5
imsiRenderModeRtFull = 6
imsiRenderModeWireFrame = 7
imsiRenderModeHiddenLine = 8
imsiRenderModeContHiddenLine = 9
imsiRenderModeRadiosity = 10
imsiRenderModeLWOpenGL_Flat = 11
imsiRenderModeLWOpenGL_Smooth = 12
imsiRenderModeLWOpenGL_Wire = 13
imsiRenderModeLWOpenGL_Wire_Color = 14
imsiRenderModeLWOpenGL_Hidden = 15
imsiRenderModeLWOpenGL_Hidden_Color = 16

Syntax

expression.DefaultMode

expression Required. An expression that returns a Render object.


Deleted Property

True if the Graphic object is on the purge/undo list.

Syntax

expression.Deleted

expression Required. An expression that returns a Graphic object.


Description Property

Returns a description of the specified object as a string.

Remarks

Use this property to give a temporary description for the BrushStyle and LineStyle objects (exists only for the lifetime of the object). TurboCAD does not setup this field for the BrushStyle and LineStyle objects.

Syntax 1

expression.Description

expression Required. An expression that returns a BrushStyle object.

Syntax 2

expression.Description

expression Required. An expression that returns a Filter object.

Syntax 3

expression.Description

expression Required. An expression that returns a LineStyle object.

Syntax 4

expression.Description

expression Required. An expression that returns a RegenMethod object.

Syntax 5

expression.Description

expression Required. An expression that returns a TieMethod object.


Direction Property

Sets the Camera object's direction vector.

Syntax

expression.Direction

expression Required. An expression that returns a Camera object.


Distance Property

A pick ray is the line through the pick point and perdendicular to the screen. The Distance property returns the distance from the pick ray to the closest point on the entity.

Syntax

expression.Distance

expression Required. An expression that returns a PickEntry object.


Domain Property

Returns the type of the Property object's container.

Syntax

expression.Domain

expression Required. An expression that returns a Property object.


Drawing Property

Returns a Drawing object that represents the owner of the specified object.

Syntax 1

expression.Drawing

expression Required. An expression that returns a Block object.

Syntax 2

expression.Drawing

expression Required. An expression that returns a Graphic object.

Syntax 3

expression.Drawing

expression Required. An expression that returns a Graphics object.

Syntax 4

expression.Drawing

expression Required. An expression that returns a GraphicSet object.

Syntax 5

expression.Drawing

expression Required. An expression that returns a GraphicSets object.

Syntax 6

expression.Drawing

expression Required. An expression that returns a Layer object.

Syntax 7

expression.Drawing

expression Required. An expression that returns a Macro object.

Syntax 8

expression.Drawing

expression Required. An expression that returns a NamedView object.

Syntax 9

expression.Drawing

expression Required. An expression that returns a PageSetup object.

Syntax 10

expression.Drawing

expression Required. An expression that returns a PaperSpace object.

Syntax 11

expression.Drawing

expression Required. An expression that returns a PickEntry object.

Syntax 12

expression.Drawing

expression Required. An expression that returns a RenderView object.

Syntax 13

expression.Drawing

expression Required. An expression that returns a Selection object.

Syntax 14

expression.Drawing

expression Required. An expression that returns a Tie object.

Syntax 15

expression.Drawing

expression Required. An expression that returns a TieSet object.

Syntax 16

expression.Drawing

expression Required. An expression that returns a TieSets object.

Syntax 17

expression.Drawing

expression Required. An expression that returns an UndoRecord object.

Syntax 18

expression.Drawing

expression Required. An expression that returns a View object.


Drawings Property

Returns the Application object's Drawings collection, the collection of Drawing objects.

Syntax 1

Drawings

Syntax 2

expression.Drawing

expression Required. An expression that returns a Application object.


Editable Property

True if the object can be edited. False if not editable.

Syntax 1

expression.Editable

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.Editable

expression Required. An expression that returns a Layer object.

Syntax 3

expression.Editable

expression Required. An expression that returns a Vertex object.


Empty Property

Returns True if the BoundingBox object empty.

Syntax

expression.Empty

expression Required. An expression that returns a BoundingBox object.


Enabled Property

True if the object is enabled.

Syntax

expression.Enabled

expression Required. An expression that returns a Tool object.


Extension Property

Returns a file extension supported by the Filter object.

Syntax

expression.Extension(Index)

expression Required. An expression that returns a Filter object.

Index Required Variant. The index of the extension.


ExtensionCount Property

Returns the number of file extensions supported by the Filter object.

Syntax

expression.ExtensionCount

expression Required. An expression that returns a Filter object.


ExternalView Property

Returns true when an external 3D rendering process is controlling the View object.

Syntax

expression.ExternalView

expression Required. An expression that returns a View object.


Filters Property

Returns the Application object's Filters collection.

Syntax 1

Filters

Syntax 2

expression.Filters

expression Required. An expression that returns an Application object.


FilterString Property

Returns the Windows Common Dialog (File Dialog Box) filter string.

Syntax

expression.FilterString

expression Required. An expression that returns a Filter object.


FixedAspectRatio Property

Returns or sets the View object's mapping to isotropic or anisotropic. True if isotropic (maintains the mapping so that one logical unit maps to the same physical distance in both x and y), otherwise False (mapping is to an arbitrary scale).

Syntax

expression.FixedAspectRatio

expression Required. An expression that returns a View object.


Frozen Property

True if Graphic objects on the Layer object cannot be edited or selected.

Syntax

expression.Frozen

expression Required. An expression that returns a Layer object.


Graphic Property

Returns the PickEntry object's Graphic object.

Syntax

expression.Graphic

expression Required. An expression that returns a PickEntry object.


Graphics Property

Returns the object's Graphics collection.

Syntax 1

expression.Graphics

expression Required. An expression that returns a Block object.

Syntax 2

expression.Graphics

expression Required. An expression that returns a Drawing object.

Syntax 3

expression.Graphics

expression Required. An expression that returns a Graphic object.

Syntax 4

expression.Graphics

expression Required. An expression that returns a PaperSpace object.


GraphicSets Property

Returns the Drawing object's GraphicSets collection.

Syntax

expression.GraphicSets

expression Required. An expression that returns a Drawing object.


Green Property

Returns the green value of the color.

Syntax

expression.Green

expression Required. An expression that returns a NamedColor object.


Hidden Property

Returns True if the filter will not appear in the TCAD's file open/save dialog boxes.

Syntax

expression.Hidden

expression Required. An expression that returns a Filter object.


Hue Property

Sets the hue of the color.

Syntax

expression.Hue

expression Required. An expression that returns a NamedColor object.


HWND Property

The HWND value of the View object's display Window.

Syntax

expression.HWND

expression Required. An expression that returns a View object.


ID Property

Returns the object's database ID.

Syntax 1

expression.ID

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.ID

expression Required. An expression that returns a Property object.

Syntax 3

expression.ID

expression Required. An expression that returns a Tool object.


Index Property

Returns the index of the item in the collection.

Syntax 1

expression.Index

expression Required. An expression that returns a Block object.

Syntax 2

expression.Index

expression Required. An expression that returns a BrushStyle object.

Syntax 3

expression.Index

expression Required. An expression that returns a Drawing object.

Syntax 4

expression.Index

expression Required. An expression that returns a Filter object.

Syntax 5

expression.Index

expression Required. An expression that returns a Graphic object.

Syntax 6

expression.Index

expression Required. An expression that returns a Layer object.

Syntax 7

expression.Index

expression Required. An expression that returns a LineStyle object.

Syntax 8

expression.Index

expression Required. An expression that returns a Macro object.

Syntax 9

expression.Index

expression Required. An expression that returns a NamedColor object.

Syntax 10

expression.Index

expression Required. An expression that returns a NamedView object.

Syntax 11

expression.Index

expression Required. An expression that returns a PaperSpace object.

Syntax 12

expression.Index

expression Required. An expression that returns a Property object.

Syntax 13

expression.Index

expression Required. An expression that returns a RegenMethod object.

Syntax 14

expression.Index

expression Required. An expression that returns a TieMethod object.

Syntax 15

expression.Index

expression Required. An expression that returns a Tool object.

Syntax 16

expression.Index

expression Required. An expression that returns a View object.


IsAttribute Property

True if the object is an attribute.

Remarks

An Attribute collection is a subcollection of Properties and represents block attribute definitions for block insertions.

Syntax

expression.IsAttribute

expression Required. An expression that returns a Property object.


IsRenderRunned Property

Returns True if rendering has begun and has not yet terminated.

Syntax

expression.IsRenderRunned

expression Required. An expression that returns a RenderView object.


Item Property

Returns a selected object from the containing collection.

Syntax 1

expression.Item(Index)

expression Required. An expression that returns a Blocks object.

Index Required Variant. Index of item to return.

Syntax 2

expression.Item(Index)

expression Required. An expression that returns a BrushPatterns object.

Index Required Variant. Index of item to return.

Syntax 3

expression.Item(Index)

expression Required. An expression that returns a BrushStyles object.

Index Required Variant. Index of item to return.

Syntax 4

expression.Item(Index)

expression Required. An expression that returns a Drawings object.

Index Required Variant. Index of item to return.

Syntax 5

expression.Item(Index)

expression Required. An expression that returns a Filters object.

Index Required Variant. Index of item to return.

Syntax 6

expression.Item(Index)

expression Required. An expression that returns a Graphics object.

Index Required Variant. Index of item to return.

Syntax 7

expression.Item(Index)

expression Required. An expression that returns a GraphicSet object.

Index Required Variant. Index of item to return.

Syntax 8

expression.Item(Index)

expression Required. An expression that returns a GraphicSets object.

Index Required Variant. Index of item to return.

Syntax 9

expression.Item(Index)

expression Required. An expression that returns a Layer object.

Index Required Variant. Index of item to return.

Syntax 10

expression.Item(Index)

expression Required. An expression that returns a Layers object.

Index Required Variant. Index of item to return.

Syntax 11

expression.Item(Index)

expression Required. An expression that returns a LineStyles object.

Index Required Variant. Index of item to return.

Syntax 12

expression.Item(Index)

expression Required. An expression that returns a Macros object.

Index Required Variant. Index of item to return.

Syntax 13

expression.Item(Index)

expression Required. An expression that returns a NamedViews object.

Index Required Variant. Index of item to return.

Syntax 14

expression.Item(Index)

expression Required. An expression that returns a PaperSpaces object.

Index Required Variant. Index of item to return.

Syntax 15

expression.Item(Index)

expression Required. An expression that returns a PickResult object.

Index Required Variant. Index of item to return.

Syntax 16

expression.Item(Index)

expression Required. An expression that returns a Properties object.

Index Required Variant. Index of item to return.

Syntax 17

expression.Item(Index)

expression Required. An expression that returns a RegenMethods object.

Index Required Variant. Index of item to return.

Syntax 18

expression.Item(Index)

expression Required. An expression that returns a Renders object.

Index Required Variant. Index of item to return.

Syntax 19

expression.Item(Index)

expression Required. An expression that returns a Selection object.

Index Required Variant. Index of item to return.

Syntax 20

expression.Item(Index)

expression Required. An expression that returns a TieMethods object.

Index Required Variant. Index of item to return.

Syntax 21

expression.Item(Index)

expression Required. An expression that returns a TieSet object.

Index Required Long. Zero-based Index of item to return.

Syntax 22

expression.Item(Index)

expression Required. An expression that returns a TieSets object.

Index Required Long. Zero-based Index of item to return.

Syntax 23

expression.Item(Index)

expression Required. An expression that returns a Tools object.

Index Required Variant. Index of item to return.

Syntax 24

expression.Item(Index)

expression Required. An expression that returns a Vertices object.

Index Required Variant. Index of item to return.

Syntax 25

expression.Item(Index)

expression Required. An expression that returns a Views object.

Index Required Variant. Index of item to return.


Layer Property

Returns the Graphic object's layer.

Syntax

expression.Layer

expression Required. An expression that returns a Graphic object.


Layers Property

Returns the Drawing object's Layers collection.

Syntax

expression.Layers

expression Required. An expression that returns a Drawing object.


LeftMargin Property

Returns the size of the left margin, in millimeters.

Syntax

expression.LeftMargin

expression Required. An expression that returns a PageSetup object.


LineStyle Property

Returns the object's LineStyle object.

Syntax 1

expression.LineStyle

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.LineStyle

expression Required. An expression that returns a Layer object.


LineStyles Property

Returns the Drawing object's LineStyles collection.

Syntax

expression.LineStyles

expression Required. An expression that returns a Drawing object.


Linkable Property

A Boolean flag that signals whether the Vertex can be tied to vertices in other graphics.

Syntax

expression.Linkable

expression Required. An expression that returns a Vertex object.

Remarks

The Linkable flag is checked by TurboCAD's internal tie mechanisms. Linkable vertices are used in associative dimensioning.


Location Property

Returns the Camera object's location.

Syntax

expression.Location

expression Required. An expression that returns a Camera object.


LookAt Property

Sets the Camera object's point of interest. The camera lens points at a target location. LookAt is a Vertex object property and is also specified in 3D world coordinates.

Syntax

expression.LookAt

expression Required. An expression that returns a Camera object.


Macros Property

Returns the Drawing object's Macros collection.

Syntax

expression.Macros

expression Required. An expression that returns a Drawing object.


MappingMode Property

Sets the mapping mode of the View object's display Window.

Syntax

expression.MappingMode

expression Required. An expression that returns a View object.


Margins Property

True if the View object's display window is inset within its client rectangle.

Syntax

expression.Margins

expression Required. An expression that returns a View object.


Max Property

Read only. A Vertex object contining the maximum X, Y and Z coordinates of the BoundingBox.

Syntax

expression.Max

expression Required. An expression that returns a BoundingBox object.


MenuText Property

Returns or sets the string that will appear in the Undo or Tool menu item..

Syntax 1

expression.MenuText(lcid)

expression Required. An expression that returns an Tool object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.

Syntax 1

expression.MenuText(lcid)

expression Required. An expression that returns an UndoRecord object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Min Property

Read only. A Vertex object contining the minimum X, Y and Z coordinates of the BoundingBox.

Syntax

expression.Min

expression Required. An expression that returns a BoundingBox object.


Modes Property

Read only. Returns an array of ImsiRenderModes: the collection of IDs for the render modes supported by this process.

Syntax

expression.Modes

expression Required. An expression that returns a Render object.


Name Property

Read only. Returns the name of the object as a string.

Syntax 1

expression.Name

expression Required. An expression that returns a Application object.

Syntax 2

expression.Name

expression Required. An expression that returns a Block object.

Syntax 3

expression.Name

expression Required. An expression that returns a BrushStyle object.

Syntax 4

expression.Name

expression Required. An expression that returns a Drawing object.

Syntax 5

expression.Name

expression Required. An expression that returns a Filter object.

Syntax 6

expression.Name

expression Required. An expression that returns a Global object.

Syntax 7

expression.Name

expression Required. An expression that returns a Graphic object.

Syntax 8

expression.Name

expression Required. An expression that returns a GraphicSet object.

Syntax 9

expression.Name

expression Required. An expression that returns a Layer object.

Syntax 10

expression.Name

expression Required. An expression that returns a LineStyle object.

Syntax 11

expression.Name

expression Required. An expression that returns a Macro object.

Syntax 12

expression.Name

expression Required. An expression that returns a NamedColor object.

Syntax 13

expression.Name

expression Required. An expression that returns a NamedView object.

Syntax 14

expression.Name

expression Required. An expression that returns a PaperSpace object.

Syntax 15

expression.Name

expression Required. An expression that returns a Property object.

Syntax 16

expression.Name

expression Required. An expression that returns a RegenMethod object.

Syntax 17

expression.Name

expression Required. An expression that returns a Render object.

Syntax 18

expression.Name

expression Required. An expression that returns a Tie object.

Syntax 19

expression.Name

expression Required. An expression that returns a TieMethod object.


NamedColors Property

Returns the Application object's NamedColors collection.

Syntax 1

NamedColors

Syntax 2

expression.NamedColors

expression Required. An expression that returns an Application object.


NamedViews Property

Returns the Drawing object's NamedViews collection.

Syntax

expression.NamedViews

expression Required. An expression that returns a Drawing object.


Nodes Property

Returns the Vertices collection which represents the editable child Vertex objects of this Graphic object.

Syntax

expression.Nodes

expression Required. An expression that returns a Graphic object.


OpenFlat Property

Returns True if the Filter object can load from a flat file.

Syntax

expression.OpenFlat

expression Required. An expression that returns a Filter object.


OpenStream Property

Returns True if the Filter object can load from an OLE stream.

Syntax

expression.OpenStream

expression Required. An expression that returns a Filter object.


PageSetup Property

Returns the Drawing object's PageSetup Object.

Syntax

expression.PageSetup

expression Required. An expression that returns a Drawing object.


PaperSpaces Property

Returns the Drawing object's PaperSpaces collection.

Syntax

expression.PaperSpaces

expression Required. An expression that returns a Drawing object.


Parent Property

Returns the parent object for the specified object.

Syntax 1

Parent

Syntax 2

expression.Parent

expression Required. An expression that returns an Application object.

Syntax 3

expression.Parent

expression Required. An expression that returns a Block object.

Syntax 4

expression.Parent

expression Required. An expression that returns a Blocks object.

Syntax 5

expression.Parent

expression Required. An expression that returns a BrushPatterns object.

Syntax 6

expression.Parent

expression Required. An expression that returns a BrushStyle object.

Syntax 7

expression.Parent

expression Required. An expression that returns a BrushStyles object.

Syntax 8

expression.Parent

expression Required. An expression that returns a Camera object.

Syntax 9

expression.Parent

expression Required. An expression that returns a Drawing object.

Syntax 10

expression.Parent

expression Required. An expression that returns a Drawings object.

Syntax 11

expression.Parent

expression Required. An expression that returns a Filter object.

Syntax 12

expression.Parent

expression Required. An expression that returns a Filters object.

Syntax 13

expression.Parent

expression Required. An expression that returns a Graphic object.

Syntax 14

expression.Parent

expression Required. An expression that returns a Graphics object.

Syntax 15

expression.Parent

expression Required. An expression that returns a GraphicSet object.

Syntax 16

expression.Parent

expression Required. An expression that returns a GraphicSets object.

Syntax 17

expression.Parent

expression Required. An expression that returns a Layer object.

Syntax 18

expression.Parent

expression Required. An expression that returns a LineStyle object.

Syntax 19

expression.Parent

expression Required. An expression that returns a LineStyles object.

Syntax 20

expression.Parent

expression Required. An expression that returns a Macro object.

Syntax 21

expression.Parent

expression Required. An expression that returns a Macros object.

Syntax 22

expression.Parent

expression Required. An expression that returns a NamedColor object.

Syntax 23

expression.Parent

expression Required. An expression that returns a NamedColors object.

Syntax 24

expression.Parent

expression Required. An expression that returns a NamedView object.

Syntax 25

expression.Parent

expression Required. An expression that returns a NamedViews object.

Syntax 26

expression.Parent

expression Required. An expression that returns a PageSetup object.

Syntax 27

expression.Parent

expression Required. An expression that returns a PaperSpace object.

Syntax 28

expression.Parent

expression Required. An expression that returns a PaperSpaces object.

Syntax 29

expression.Parent

expression Required. An expression that returns a PickEntry object.

Syntax 30

expression.Parent

expression Required. An expression that returns a PickResult object.

Syntax 31

expression.Parent

expression Required. An expression that returns a Property object.

Syntax 32

expression.Parent

expression Required. An expression that returns a Properties object.

Syntax 33

expression.Parent

expression Required. An expression that returns a RegenMethod object.

Syntax 34

expression.Parent

expression Required. An expression that returns a RegenMethods object.

Syntax 35

expression.Parent

expression Required. An expression that returns a Render object.

Syntax 36

expression.Parent

expression Required. An expression that returns a Renders object.

Syntax 37

expression.Parent

expression Required. An expression that returns a RenderView object.

Syntax 38

expression.Parent

expression Required. An expression that returns a RenderViews object.

Syntax 39

expression.Parent

expression Required. An expression that returns a Selection object.

Syntax 40

expression.Parent

expression Required. An expression that returns a Tie object.

Syntax 41

expression.Parent

expression Required. An expression that returns a TieMethod object.

Syntax 42

expression.Parent

expression Required. An expression that returns a TieMethods object.

Syntax 43

expression.Parent

expression Required. An expression that returns a TieSet object.

Syntax 44

expression.Parent

expression Required. An expression that returns a TieSets object.

Syntax 45

expression.Parent

expression Required. An expression that returns a Tool object.

Syntax 46

expression.Parent

expression Required. An expression that returns a Tools object.

Syntax 47

expression.Parent

expression Required. An expression that returns a UndoRecord object.

Syntax 48

expression.Parent

expression Required. An expression that returns a Vertices object.

Syntax 49

expression.Parent

expression Required. An expression that returns a View object.

Syntax 50

expression.Parent

expression Required. An expression that returns a Views object.


Path Property

Read only. Returns the complete path of the object, as a string, without including the final separator and name of the object.

Syntax 1

expression.Path(lcid)

expression Required. An expression that returns an Application object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.

Syntax 2

expression.Path(lcid)

expression Required. An expression that returns an Drawing object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.

Syntax 1

expression.Path(lcid)

expression Required. An expression that returns an Macro object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


PenDown Property

A Boolean flag that signals that the segment from this Vertex to the next Vertex in a polyline should be drawn.

Syntax

expression.PenDown

expression Required. An expression that returns a Vertex object.

Remarks

The PenDown flag is normally set for newly created vertices. Graphic subtypes other than polylines, that have specific uses for particular vertices may ignore the PenDown flag. See the In Depth section of the documentation for information on specific graphic subtypes and their use of the PenDown flag.


Perspective Property

Returns True if the Camera objects is used in a perspective projection (verses orthographic projection).

Remarks

The orthographic projection is the equivalent of an optical camera with an infinite focal length (hyper-telephoto) - there are no vanishing points or foreshortening in the picture taken by this camera.

Syntax

expression.Perspective

expression Required. An expression that returns a Camera object.


PerspectiveAngle Property

Controls the focal length of the Camera object by specifying an angle in degrees between zero (infinite focal length telephoto) and 180 (fish-eye wideangle).

Syntax

expression.PerspectiveAngle

expression Required. An expression that returns a Camera object.


PickVertex Property

Returns the actual vertex of the mouse click.

Syntax

expression.PickVertex

expression Required. An expression that returns a PickResult object.


Picture Property

Read only. Returns a StdPicture object containing the bitmap of the current rendering.

Syntax

expression.Picture

expression Required. An expression that returns a RenderView object.


PrinterHeight Property

Sets the printer paper height, in millimeters.

Syntax

expression.PrinterHeight

expression Required. An expression that returns a PageSetup object.


PrinterOrientation Property

Sets the printer paper orientation.

Syntax

expression.PrinterOrientation

expression Required. An expression that returns a PageSetup object.


PrinterWidth Property

Sets the printer paper width, in millimeters.

Syntax

expression.PrinterWidth

expression Required. An expression that returns a PageSetup object.


Priority Property

Returns the object's priority.

Syntax 1

expression.Priority

expression Required. An expression that returns a Filter object.

Syntax 2

expression.Priority

expression Required. An expression that returns a Tie object.


ProfileName Property

Returns the profile name.

Syntax

expression.ProfileName

expression Required. An expression that returns an Application object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Prompt Property

Sets or returns the string that will appear in the status bar.

Syntax

expression.Prompt(lcid)

expression Required. An expression that returns a Tool object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Properties Property

Returns the object's Properties collection.

Syntax 1

Properties

Syntax 2

expression.Properties

expression Required. An expression that returns an Application object.

Syntax 3

expression.Properties

expression Required. An expression that returns a Drawing object.

Syntax 4

expression.Properties

expression Required. An expression that returns a Graphic object.

Syntax 5

expression.Properties

expression Required. An expression that returns a PaperSpace object.

Syntax 6

expression.Properties

expression Required. An expression that returns a Tool object.


RadExtendedMode Property

Secondary rendering mode if primary mode is set to Radiosity.

Syntax 1

expression.RadExtendedMode

expression Required. An expression that returns a Render object.

Syntax 2

expression.RadExtendedMode

expression Required. An expression that returns a RenderView object.


RadExtendedModes Property

Read only. An array of ImsiRenderModes: the collection of IDs for the radiosity render modes supported by this process.

Syntax

expression.RadExtendedModes

expression Required. An expression that returns a Render object.


RadExtendedRenderModesCount Property

Read only. The number of radiosity render modes that this process supports.

Syntax

expression.RadExtendedRenderModesCount

expression Required. An expression that returns a Render object.


RadIterationsCount Property

Number of interations for radiosity rendering.

Remarks

Controls quality setting for radiosity rendering.

Syntax 1

expression.RadIterationsCount

expression Required. An expression that returns a Render object.

Syntax 2

expression.RadIterationsCount

expression Required. An expression that returns a RenderView object.


RadMaxArea Property

This property is used to affect the quality of rendering. Use this property to manually adjust smoothing of shadows.

Remarks

Adjusting this parameter, along with RadMinArea, can seriously increase the time to render.

Syntax

expression.RadMaxArea

expression Required. An expression that returns a Render object.


RadMinArea Property

This property is used to affect the quality of rendering. Use this property to manually adjust smoothing of shadows.

Remarks

Adjusting this parameter, along with RadMaxArea, can seriously increase the time to render.

Syntax

expression.RadMinArea

expression Required. An expression that returns a Render object.


RadQuality Property

Sets or returns the quality settings for radiosity rendering.

Remarks

This is the integrated parameter for improving the quality of an object’s shadow displaying. Each quality value corresponds to the default set of radiosity parameters.

Syntax

expression.RadQuality

expression Required. An expression that returns a Render object.


Red Property

Returns the red value of the color.

Syntax

expression.Red

expression Required. An expression that returns a NamedColor object.


ReferencePoint Property

Read only. Returns the reference point of the Graphic object.

Remarks

The reference point of a Graphic is usually calculated as the center of the Graphic's bounding box, as obtained by the CalcBoundingBox method.

Syntax

expression.ReferencePoint(bUseWorldCS)

expression Required. An expression that returns a Graphic object.

bUseWorldCS Optional Variant. Flag to return the coordinates using World Coordinate System instead of local graphic coordinate system.


RegenMethods Property

Returns the Application object's RegenMethods collection.

Syntax 1

RegenMethods

Syntax 2

expression.RegenMethods

expression Required. An expression that returns an Application object.


RegenType Property

Returns the Graphic object's regen type.

Syntax

expression.RegenType

expression Required. An expression that returns a Graphic object.


RelativeOrigin Property

Returns the location of the relative origin, as a Vertex object.

Syntax

expression.RelativeOrigin

expression Required. An expression that returns a Drawing object.


RenderID Property

A user-definable ID. If the RenderView has previously been initialized, setting the RenderID property starts another rendering job.

Syntax

expression.RenderID

expression Required. An expression that returns a RenderView object.


RenderMode Property

Primary rendering mode for 3D rendering process.

Syntax

expression.RenderMode

expression Required. An expression that returns a RenderView object.


RenderModesCount Property

Read only. The number of primary render modes that this process supports.

Syntax

expression.RenderModesCount

expression Required. An expression that returns a Render object.


Renders Property

Returns the Application object's Renders collection.

Syntax 1

Renders

Syntax 2

expression.Renders

expression Required. An expression that returns an Application object.


RenderView Property

Read only. Returns the RenderView that controls the View object.

Syntax

expression.RenderView

expression Required. An expression that returns a View object.


Right Property

Sets the Camera object's right vector.

Syntax

expression.Right

expression Required. An expression that returns a Camera object.


RightMargin Property

Sets the size of the right margin, in millimeters.

Syntax

expression.RightMargin

expression Required. An expression that returns a PageSetup object.


Root Property

True if the Graphic object is the root of a tree.

Syntax

expression.Root

expression Required. An expression that returns a Graphic object.


Rows Property

Sets the number of rows necessary to tile the sheet width.

Syntax

expression.Rows

expression Required. An expression that returns a PageSetup object.


Saturation Property

Returns the saturation value of the color.

Syntax

expression.Saturation

expression Required. An expression that returns a NamedColor object.


Saved Property

True if no changes have been made to the Drawing object since it was last saved.

Syntax

expression.Saved

expression Required. An expression that returns a Drawing object.


SaveFlat Property

Returns True if the Filter object can save to a flat file.

Syntax

expression.SaveFlat

expression Required. An expression that returns a Filter object.


SaveStream Property

Returns True if the Filter object can save to an OLE stream.

Syntax

expression.SaveStream

expression Required. An expression that returns a Filter object.


Scale Property

Sets the drawing scale as a number or string.

Syntax

expression.Scale

expression Required. An expression that returns a PageSetup object.


ScreenHeight Property

The height in the View object's screen space.

Syntax

expression.ScreenHeight

expression Required. An expression that returns a View object.


ScreenLeft Property

The x coordinate of the left hand side of the View object's screen space.

Syntax

expression.ScreenLeft

expression Required. An expression that returns a View object.


ScreenTop Property

The y coordinate of the top of the View object's screen space.

Syntax

expression.ScreenTop

expression Required. An expression that returns a View object.


ScreenWidth Property

The width in the View object's screen space.

Syntax

expression.ScreenWidth

expression Required. An expression that returns a View object.


Selectable Property

A Boolean flag that signals that this Vertex can be selected in the user interface.

Syntax

expression.Selectable

expression Required. An expression that returns a Vertex object.


Selected Property

Returns True if the Graphic is part of a Drawing's Selection.

Syntax

expression.Selected

expression Required. An expression that returns a Graphic object.


Selection Property

Returns the object's Selection object.

Syntax 1

Selection

Syntax 2

expression.Selection

expression Required. An expression that returns a Application object.

Syntax 3

expression.Selection

expression Required. An expression that returns a Drawing object.


SheetHeight Property

Returns the sheet height, in millimeters.

Syntax

expression.SheetHeight

expression Required. An expression that returns a PageSetup object.


SheetOrientation Property

Returns the sheet orientation.

Syntax

expression.SheetOrientation

expression Required. An expression that returns a PageSetup object.


SheetWidth Property

Sets the sheet width, in millimeters.

Syntax

expression.SheetWidth

expression Required. An expression that returns a PageSetup object.


SnapModes Property

Sets or returns the active snap mode. The value is a long integer corresponding to the ImsiSnapMode enumerated values.

Remarks

Snapping to the grid (ImsiSnapGrid) is not applicable when you use the TurboCAD engine as in-process server.

Syntax

expression.SnapModes

expression Required. An expression that returns an Application object.


Snappable Property

A Boolean flag that signals that the Vertex can be snapped to in the user interface.

Syntax

expression.Snappable

expression Required. An expression that returns a Vertex object.


SpaceMode Property

Returns or sets the Drawing's space (Model Space or Paper Space) represented by the View.

Syntax

expression.SpaceMode

expression Required. An expression that returns a View object.


Subject Property

Returns the "Subject" graphic of the TieSet.

Remarks

Note - the subject graphic and the subordinate graphic may be the same graphic.

Syntax

expression.Subject

expression Required. An expression that returns a TieSet object.


Subordinate Property

Returns the "Subordinate" graphic of the TieSet.

Remarks

Note - the subject graphic and the subordinate graphic may be the same graphic.

Syntax

expression.Subordinate

expression Required. An expression that returns a TieSet object.


Surface Property

Returns the surface object for a Surface Graphic object.

Syntax

expression.Surface

expression Required. An expression that returns a Graphic object.


TieMethods Property

Returns the Application object's TieMethods collection.

Syntax

expression.TieMethods

expression Required. An expression that returns an Application object.


TieSet Property

Returns part of a collection.

Syntax

expression.TieSet(varSbj, varSbd)

expression Required. An expression that returns a TieSets object.

varSbj Required Variant. ID / Dispatch of Subject Graphic.

varSbd Required Variant. ID / Dispatch of Subordinate Graphic


TieSets Property

Returns the Drawing object's TieSets collection.

Syntax

expression.TieSets

expression Required. An expression that returns a Drawing object.


ToolEvents Property

Returns the application object's ToolEvents.

Syntax 1

ToolEvents

Syntax 2

expression.ToolEvents

expression Required. An expression that returns a Application object.


TooltipText Property

Sets or returns the string that will appear in tool tips.

Syntax

expression.TooltipText(lcid)

expression Required. An expression that returns a Tool object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


TopMargin Property

Sets the size of the top margin, in millimeters.

Syntax

expression.TopMargin

expression Required. An expression that returns a PageSetup object.


Type Property

Returns the type of the RegenMethod object.

Syntax 1

expression.Type

expression Required. An expression that returns a BrushStyle object.

Syntax 2

expression.Type

expression Required. An expression that returns a Drawing object.

Syntax 3

expression.Type

expression Required. An expression that returns a Graphic object.

Syntax 4

expression.Type

expression Required. An expression that returns a Property object.

Syntax 5

expression.Type

expression Required. An expression that returns a RegenMethod object.

Syntax 6

expression.Type

expression Required. An expression that returns a Render object.

Syntax 7

expression.Type

expression Required. An expression that returns a TieMethod object.


TypeByValue Property

Returns the Graphic object's type, as an enumerated value.

Syntax

expression.TypeByValue

expression Required. An expression that returns a Graphic object.


UCS Property

Returns the user coordinate system as a Matrix object.

Syntax 1

expression.UCS

expression Required. An expression that returns a Drawing object.

Syntax 2

expression.UCS

expression Required. An expression that returns a Graphic object.


Unbounded Property

True if the Graphic object is unbounded (Graphic has no endpoints; e.g. for construction lines).

Syntax

expression.Unbounded

expression Required. An expression that returns a Graphic object.


Up Property

Returns the Camera object's up vector.

Syntax

expression.Up

expression Required. An expression that returns a Camera object.


Update Property

True if changes to the View object parameters will be immmediately reflected.

Syntax

expression.Update

expression Required. An expression that returns a View object.


UserControl Property

True if the user interface is active.

Syntax

expression.UserControl

expression Required. An expression that returns an Application object.


UseWorldCS Property

Set to True to automatically convert from LCS to WCS.

Remarks

To specify a coordinate system use the UseWorldCS property (Boolean) of the Vertices collection that a particular Vertex object belongs to. The UseWorldCS property's scope is directly related to the Graphic object. This means that this property setting exists only as long as the corresponding Graphic object exists.

The UseWorldCS property is meaningful only for the Vertex objects of the given collection, and does not affect higher hierarchy objects, e.g. Graphic. Also setting this property for the Vertices collection of a parent Graphic object does not automatically set this property for Vertices collections of child Graphic objects.

Syntax

expression.UseWorldCS

expression Required. An expression that returns a Vertices object.


Value Property

Sets the value of the Property object.

Syntax

expression.Value(lcid)

expression Required. An expression that returns a Property object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Version Property

Returns the version number of TurboCAD, as a string.

Syntax

expression.Version(lcid)

expression Required. An expression that returns an Application object.

lcid Optional Long. For locale, not currently used. Value should be 0 if specified.


Vertices Property

Returns a Vertices collection which contains the vertex or vertices which defined the pick result or graphic.

Syntax 1

expression.Vertices

expression Required. An expression that returns a Graphic object.

Syntax 2

expression.Vertices

expression Required. An expression that returns a PickResult object.


View Property

Returns the Drawing object that owns the object.

Syntax

expression.View

expression Required. An expression that returns a RenderView object.


ViewHeight Property

The height in the View object's view space.

Syntax

expression.ViewHeight

expression Required. An expression that returns a View object.


ViewLeft Property

The x coordinate of the left hand side of the View object's view space.

Syntax

expression.ViewLeft

expression Required. An expression that returns a View object.


Views Property

Returns the Drawing object's Views collection.

Syntax

expression.Views

expression Required. An expression that returns a Drawing object.


ViewTop Property

The y coordinate of the top of the View object's view space.

Syntax

expression.ViewTop

expression Required. An expression that returns a View object.


ViewWidth Property

The width in the View object's view space.

Syntax

expression.ViewWidth

expression Required. An expression that returns a View object.


Visible Property

True if Graphic objects on the Layer object can be displayed. True if Graphic can be displayed.

Syntax 1

expression.Visible

expression Required. An expression that returns a Graphic object.

Syntax 1

expression.Visible

expression Required. An expression that returns a Layer object.


X Property

The x coordinate value of a point or direction vector in three dimensional space.

Syntax

expression.X

expression Required. An expression that returns a Vertex object.


XRef Property

Read only. Returns the anchor point for insertions.

Syntax

expression.XRef

expression Required. An expression that returns a Block object.


XRefPath Property

If the Block is an Xref, this property holds the location of the external drawing, as a string.

Syntax

expression.XRefPath

expression Required. An expression that returns a Block object.


Y Property

The y coordinate value of a point or direction vector in three dimensional space.

Syntax

expression.Y

expression Required. An expression that returns a Vertex object.


Z Property

The z coordinate value of a point or direction vector in three dimensional space.

Syntax

expression.Z

expression Required. An expression that returns a Vertex object.


ZOrder Property

Sets the Layer object's redraw order.

Syntax

expression.ZOrder

expression Required. An expression that returns a Layer object.


Building Advanced Projects with the SDK

This section discusses building servers, ties, filters, regen methods, standalone CAD applications and other projects that require an outside compiler.


SDK Documentation Banners

Here are some of the banners submitted by our beta testers. If you'd like to submit your own, just post it on the TurboCAD forum, or mail it to us. Banners should be 400x40 pixels in size, and ideally should contain only the words "TurboCAD SDK Documentation".


_PickPoint Method

Description missing

Syntax

expression._PickPoint(X, Y, Aperture, Snap, GGD, bTopLevel, bInvisible)

expression Required. An expression that returns a View object.

X Required Double. Description missing

Y Required Double. Description missing

Aperture Required Double. Description missing

Snap Required Long. Description missing

GGD Required Long. Description missing

bTopLevel Required Boolean. Description missing

bInvisible Required Boolean. Description missing

Return Value

PickResult. Description missing


_PickRect Method

Description missing

Syntax

expression._PickRect(Left, Top, Right, Bottom, Snap, GGD, bTopLevel, bInvisible)

expression Required. An expression that returns a View object.

Left Required Double. Description missing

Top Required Double. Description missing

Right Required Double. Description missing

Bottom Required Double. Description missing

Snap Required Long. Description missing

GGD Required Long. Description missing

bTopLevel Required Boolean. Description missing

bInvisible Required Boolean. Description missing

Return Value

PickResult. Description missing


_VirtualIntersection Method

Description missing

Syntax

expression._VirtualIntersection(V, g1, g2)

expression Required. An expression that returns a View object.

V Required Long. Description missing

g1 Required Long. Description missing

g2 Required Long. Description missing

Return Value

PickResult. Description missing


AddArcTanTo3Arcs Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddArcTanTo3Arcs(Arc1, Arc2, Arc3, StartAngle, EndAngle)

expression Required. An expression that returns a GraphicSet object.

Arc1 Required Graphic. [[[Describe Parameter Here]]]

Arc2 Required Graphic. [[[Describe Parameter Here]]]

Arc3 Required Graphic. [[[Describe Parameter Here]]]

StartAngle Required Double. [[[Describe Parameter Here]]]

EndAngle Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddArcTanToArc Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddArcTanToArc(TangentTo, X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a GraphicSet object.

TangentTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

StartAngle Required Double. [[[Describe Parameter Here]]]

EndAngle Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddArcTanToLine Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddArcTanToLine(TangentTo, X0, Y0, Z0, X1, Y1, Z1, StartAngle, EndAngle)

expression Required. An expression that returns a GraphicSet object.

TangentTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

StartAngle Required Double. [[[Describe Parameter Here]]]

EndAngle Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddCircleTan3Arcs Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddCircleTan3Arcs(Arc1, Arc2, Arc3)

expression Required. An expression that returns a GraphicSet object.

Arc1 Required Graphic. [[[Describe Parameter Here]]]

Arc2 Required Graphic. [[[Describe Parameter Here]]]

Arc3 Required Graphic. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddCircleTanToArc Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddCircleTanToArc(TangentTo, X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a GraphicSet object.

TangentTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddCircleTanToLine Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddCircleTanToLine(TangentTo, X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a GraphicSet object.

TangentTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionAngular Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionAngular(Line1, Line2, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

Line1 Required Graphic. [[[Describe Parameter Here]]]

Line2 Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionBaseline Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionBaseline(AddTo, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

AddTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionContinuous Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionContinuous(AddTo, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

AddTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionDatum Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionDatum(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

X2 Required Double. [[[Describe Parameter Here]]]

Y2 Required Double. [[[Describe Parameter Here]]]

Z2 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionDiameter Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionDiameter(Arc, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

Arc Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionHorizontal Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionHorizontal(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

X2 Required Double. [[[Describe Parameter Here]]]

Y2 Required Double. [[[Describe Parameter Here]]]

Z2 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionLeader Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionLeader(X0, Y0, Z0, Text)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Text Required String. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionParallel Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionParallel(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

X2 Required Double. [[[Describe Parameter Here]]]

Y2 Required Double. [[[Describe Parameter Here]]]

Z2 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionRadius Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionRadius(Arc, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

Arc Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionRotated Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionRotated(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

X2 Required Double. [[[Describe Parameter Here]]]

Y2 Required Double. [[[Describe Parameter Here]]]

Z2 Required Double. [[[Describe Parameter Here]]]

X3 Required Double. [[[Describe Parameter Here]]]

Y3 Required Double. [[[Describe Parameter Here]]]

Z3 Required Double. [[[Describe Parameter Here]]]

X4 Required Double. [[[Describe Parameter Here]]]

Y4 Required Double. [[[Describe Parameter Here]]]

Z4 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDimensionVertical Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDimensionVertical(X0, Y0, Z0, X1, Y1, Z1, X2, Y2, Z2)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

X2 Required Double. [[[Describe Parameter Here]]]

Y2 Required Double. [[[Describe Parameter Here]]]

Z2 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLineIrregularPolygon Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLineIrregularPolygon(X0, Y0, Z0, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLineMultiline Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLineMultiline(X0, Y0, Z0, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLineParallel Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLineParallel(ParallelTo, X0, Y0, Z0, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

ParallelTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLinePerpendicular Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLinePerpendicular(PerpTo, X0, Y0, Z0, X1, Y1, Z1, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

PerpTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLinePolygon Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLinePolygon(X0, Y0, Z0, X1, Y1, Z1, Sides, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Sides Required Long. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLineRectangle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLineRectangle(X0, Y0, Z0, X1, Y1, Z1, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLineRotatedRectangle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLineRotatedRectangle(X0, Y0, Z0, X1, Y1, Z1, Angle, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Angle Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddDoubleLineSingle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddDoubleLineSingle(X0, Y0, Z0, X1, Y1, Z1, DoubleLineOffset)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

DoubleLineOffset Required Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddGroup Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddGroup(Name, Copy)

expression Required. An expression that returns a GraphicSet object.

Name Required Variant. [[[Describe Parameter Here]]]

Copy Optional Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddLineTan2Arcs Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddLineTan2Arcs(Arc1, Arc2, CounterClockwise)

expression Required. An expression that returns a GraphicSet object.

Arc1 Required Graphic. [[[Describe Parameter Here]]]

Arc2 Required Graphic. [[[Describe Parameter Here]]]

CounterClockwise Required Boolean. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddLineTanArcPoint Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddLineTanArcPoint(TangentTo, X0, Y0, Z0, length)

expression Required. An expression that returns a GraphicSet object.

TangentTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

length Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddLineTanFromArc Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddLineTanFromArc(TangentFrom, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

TangentFrom Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddLineTanToArc Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddLineTanToArc(TangentTo, X0, Y0, Z0)

expression Required. An expression that returns a GraphicSet object.

TangentTo Required Graphic. [[[Describe Parameter Here]]]

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


AddObject Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AddObject(ClassType, Filename, LinkToFile, DisplayAsIcon, IconFileName, IconIndex, IconLabel, X, Y, Z, Width, Height, Anchor)

expression Required. An expression that returns a GraphicSet object.

ClassType Required Variant. [[[Describe Parameter Here]]]

Filename Optional Variant. [[[Describe Parameter Here]]]

LinkToFile Optional Variant. [[[Describe Parameter Here]]]

DisplayAsIcon Optional Variant. [[[Describe Parameter Here]]]

IconFileName Optional Variant. [[[Describe Parameter Here]]]

IconIndex Optional Variant. [[[Describe Parameter Here]]]

IconLabel Optional Variant. [[[Describe Parameter Here]]]

X Optional Variant. [[[Describe Parameter Here]]]

Y Optional Variant. [[[Describe Parameter Here]]]

Z Optional Variant. [[[Describe Parameter Here]]]

Width Optional Variant. [[[Describe Parameter Here]]]

Height Optional Variant. [[[Describe Parameter Here]]]

Anchor Optional Variant. [[[Describe Parameter Here]]]

Return Value

Graphic. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


Align Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.Align(AlignType)

expression Required. An expression that returns a GraphicSet object.

AlignType Required ImsiAlignType. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


AlignAlongLine Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.AlignAlongLine(X0, Y0, Z0, X1, Y1, Z1)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


ApplyStyle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.ApplyStyle(StyleToApply)

expression Required. An expression that returns a GraphicSet object.

StyleToApply Required Style. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


ArrayCopyAbsolute Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.ArrayCopyAbsolute(X, Y, Z, Rows, Columns, Fit, XRef, YRef, ZRef, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

X Required Double. [[[Describe Parameter Here]]]

Y Required Double. [[[Describe Parameter Here]]]

Z Required Double. [[[Describe Parameter Here]]]

Rows Required Long. [[[Describe Parameter Here]]]

Columns Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

XRef Optional Variant. [[[Describe Parameter Here]]]

YRef Optional Variant. [[[Describe Parameter Here]]]

ZRef Optional Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


ArrayCopyRelative Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.ArrayCopyRelative(U, V, Rows, Columns, Fit, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

U Required Double. [[[Describe Parameter Here]]]

V Required Double. [[[Describe Parameter Here]]]

Rows Required Long. [[[Describe Parameter Here]]]

Columns Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


CheckSpelling Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.CheckSpelling(CustomDictionary, IgnoreUppercase, AlwaysSuggest, CustomDictionary2, CustomDictionary3, CustomDictionary4, CustomDictionary5, CustomDictionary6, CustomDictionary7, CustomDictionary8, CustomDictionary9, CustomDictionary10)

expression Required. An expression that returns a GraphicSet object.

CustomDictionary Optional Variant. [[[Describe Parameter Here]]]

IgnoreUppercase Optional Variant. [[[Describe Parameter Here]]]

AlwaysSuggest Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary2 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary3 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary4 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary5 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary6 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary7 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary8 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary9 Optional Variant. [[[Describe Parameter Here]]]

CustomDictionary10 Optional Variant. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


ClearConstruction Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.ClearConstruction

expression Required. An expression that returns a GraphicSet object.

Remarks

[[[Insert Remarks Here]]]


Copy Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.Copy

expression Required. An expression that returns a GraphicSet object.

Remarks

[[[Insert Remarks Here]]]


CreateStyle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.CreateStyle(BasedOn)

expression Required. An expression that returns a GraphicSet object.

BasedOn Required Style. [[[Describe Parameter Here]]]

Return Value

Style. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


Cut Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.Cut

expression Required. An expression that returns a GraphicSet object.

Remarks

[[[Insert Remarks Here]]]


EnumObjPropInfo Method

[[[IObjPropManager Interface]]]

Syntax

expression.EnumObjPropInfo(dwKind, plContext, pdwID, plCatIndex, plPropIndex, pbEnableType, pvarDefVal)

expression Required. An expression that returns a IObjPropManager object.

dwKind Required Long. [[[Describe Parameter Here]]]

plContext Required Long. [[[Describe Parameter Here]]]

pdwID Required Long. [[[Describe Parameter Here]]]

plCatIndex Required Long. [[[Describe Parameter Here]]]

plPropIndex Required Long. [[[Describe Parameter Here]]]

pbEnableType Required Byte. [[[Describe Parameter Here]]]

pvarDefVal Required Variant. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


FindControl Method

[[[The collection of customizable command bars.]]]

Syntax

expression.FindControl(Type, ID, Tag, Visible)

expression Required. An expression that returns a CommandBars object.

Type Required ImsiControlType. [[[Describe Parameter Here]]]

ID Required Variant. [[[Describe Parameter Here]]]

Tag Optional Variant. [[[Describe Parameter Here]]]

Visible Optional Variant. [[[Describe Parameter Here]]]

Return Value

CommandBarControl. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


FindControlId Method

[[[The collection of customizable command bars.]]]

Syntax

expression.FindControlId(Type, CommandName, Caption, Tag, Visible)

expression Required. An expression that returns a CommandBars object.

Type Required ImsiControlType. [[[Describe Parameter Here]]]

CommandName Required Variant. [[[Describe Parameter Here]]]

Caption Optional Variant. [[[Describe Parameter Here]]]

Tag Optional Variant. [[[Describe Parameter Here]]]

Visible Optional Variant. [[[Describe Parameter Here]]]

Return Value

Long. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


GetData Method

[[[ITable Interface]]]

Syntax

expression.GetData(dwID, pvarVal)

expression Required. An expression that returns a TCTable object.

dwID Required Long. [[[Describe Parameter Here]]]

pvarVal Required Variant. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


GetValue Method

[[[Insert Description Here]]]

Syntax

expression.GetValue(varArray)

expression Required. An expression that returns a TCNamedArray object.

varArray Required Variant. [[[Describe Parameter Here]]]

Return Value

Variant. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


Init Method

[[[ITable Interface]]]

Syntax

expression.Init(dwID, pvarOwner)

expression Required. An expression that returns a TCTable object.

dwID Required Long. [[[Describe Parameter Here]]]

pvarOwner Required Variant. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


LinearCopyAbsolute Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.LinearCopyAbsolute(X, Y, Z, Copies, Fit, XRef, YRef, ZRef, Matrix)

expression Required. An expression that returns a GraphicSet object.

X Required Double. [[[Describe Parameter Here]]]

Y Required Double. [[[Describe Parameter Here]]]

Z Required Double. [[[Describe Parameter Here]]]

Copies Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

XRef Optional Variant. [[[Describe Parameter Here]]]

YRef Optional Variant. [[[Describe Parameter Here]]]

ZRef Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


LinearCopyAngle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.LinearCopyAngle(length, Angle, Copies, Fit, XRef, YRef, ZRef, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

length Required Double. [[[Describe Parameter Here]]]

Angle Required Double. [[[Describe Parameter Here]]]

Copies Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

XRef Optional Variant. [[[Describe Parameter Here]]]

YRef Optional Variant. [[[Describe Parameter Here]]]

ZRef Optional Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


LinearCopyRelative Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.LinearCopyRelative(X, Y, Z, Copies, Fit, Matrix)

expression Required. An expression that returns a GraphicSet object.

X Required Double. [[[Describe Parameter Here]]]

Y Required Double. [[[Describe Parameter Here]]]

Z Required Double. [[[Describe Parameter Here]]]

Copies Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


MirrorCopyAngle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.MirrorCopyAngle(X, Y, Z, Angle, Copy, XRef, YRef, ZRef, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

X Required Double. [[[Describe Parameter Here]]]

Y Required Double. [[[Describe Parameter Here]]]

Z Required Double. [[[Describe Parameter Here]]]

Angle Required Double. [[[Describe Parameter Here]]]

Copy Required Variant. [[[Describe Parameter Here]]]

XRef Optional Variant. [[[Describe Parameter Here]]]

YRef Optional Variant. [[[Describe Parameter Here]]]

ZRef Optional Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


MirrorCopyLine Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.MirrorCopyLine(X0, Y0, Z0, X1, Y1, Z1, Copy, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Copy Required Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


Modify Method

[[[ITable Interface]]]

Syntax

expression.Modify(wFlags)

expression Required. An expression that returns a TCTable object.

wFlags Required Integer. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


OnKey Method

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnKey(Key, Procedure)

expression Required. An expression that returns a ApplicationCallbacks object.

Key Required String. [[[Describe Parameter Here]]]

Procedure Optional Variant. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


OnRepeat Method

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnRepeat(Text, Procedure)

expression Required. An expression that returns a ApplicationCallbacks object.

Text Required String. [[[Describe Parameter Here]]]

Procedure Required String. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


OnTime Method

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnTime(EarliestTime, Procedure, LatestTime, Schedule)

expression Required. An expression that returns a ApplicationCallbacks object.

EarliestTime Required Variant. [[[Describe Parameter Here]]]

Procedure Required String. [[[Describe Parameter Here]]]

LatestTime Optional Variant. [[[Describe Parameter Here]]]

Schedule Optional Variant. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


OnUndo Method

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnUndo(Text, Procedure)

expression Required. An expression that returns a ApplicationCallbacks object.

Text Required String. [[[Describe Parameter Here]]]

Procedure Required String. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


PropertyChangeCategory Method

[[[Insert Description Here]]]

Syntax

expression.PropertyChangeCategory(pIDispProp)

expression Required. An expression that returns a IDBPROPEVENTS object.

pIDispProp Required Object. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


PropertyChangeName Method

[[[Insert Description Here]]]

Syntax

expression.PropertyChangeName(pIDispProp)

expression Required. An expression that returns a IDBPROPEVENTS object.

pIDispProp Required Object. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


PropertyChangeParent Method

[[[Insert Description Here]]]

Syntax

expression.PropertyChangeParent(pIDispProp)

expression Required. An expression that returns a IDBPROPEVENTS object.

pIDispProp Required Object. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


PropertyChangeState Method

[[[Insert Description Here]]]

Syntax

expression.PropertyChangeState(pIDispProp)

expression Required. An expression that returns a IDBPROPEVENTS object.

pIDispProp Required Object. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


PropertyChangeType Method

[[[Insert Description Here]]]

Syntax

expression.PropertyChangeType(pIDispProp)

expression Required. An expression that returns a IDBPROPEVENTS object.

pIDispProp Required Object. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


PropertyChangeValue Method

[[[Insert Description Here]]]

Syntax

expression.PropertyChangeValue(pIDispProp)

expression Required. An expression that returns a IDBPROPEVENTS object.

pIDispProp Required Object. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


RadialCopyAbsolute Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.RadialCopyAbsolute(X0, Y0, Z0, X1, Y1, Z1, Copies, Fit, XRef, YRef, ZRef, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

X0 Required Double. [[[Describe Parameter Here]]]

Y0 Required Double. [[[Describe Parameter Here]]]

Z0 Required Double. [[[Describe Parameter Here]]]

X1 Required Double. [[[Describe Parameter Here]]]

Y1 Required Double. [[[Describe Parameter Here]]]

Z1 Required Double. [[[Describe Parameter Here]]]

Copies Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

XRef Optional Variant. [[[Describe Parameter Here]]]

YRef Optional Variant. [[[Describe Parameter Here]]]

ZRef Optional Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


RadialCopyAngle Method

[[[A named set of references to Graphic objects in a Drawing object.]]]

Syntax

expression.RadialCopyAngle(X, Y, Z, Angle, RotationAngle, Copies, Fit, XRef, YRef, ZRef, Workplane, Matrix)

expression Required. An expression that returns a GraphicSet object.

X Required Double. [[[Describe Parameter Here]]]

Y Required Double. [[[Describe Parameter Here]]]

Z Required Double. [[[Describe Parameter Here]]]

Angle Required Double. [[[Describe Parameter Here]]]

RotationAngle Required Double. [[[Describe Parameter Here]]]

Copies Required Long. [[[Describe Parameter Here]]]

Fit Required Variant. [[[Describe Parameter Here]]]

XRef Optional Variant. [[[Describe Parameter Here]]]

YRef Optional Variant. [[[Describe Parameter Here]]]

ZRef Optional Variant. [[[Describe Parameter Here]]]

Workplane Optional Variant. [[[Describe Parameter Here]]]

Matrix Optional Variant. [[[Describe Parameter Here]]]

Return Value

GraphicSet. [[[Insert Retval Description Here]]]

Remarks

[[[Insert Remarks Here]]]


RegisterCategory Method

[[[IPropertyManager Interface]]]

Syntax

expression.RegisterCategory(dwCatID, bstrIName, bstrUName, dwData, plIndex)

expression Required. An expression that returns a PropertyManager object.

dwCatID Required Long. [[[Describe Parameter Here]]]

bstrIName Required String. [[[Describe Parameter Here]]]

bstrUName Required String. [[[Describe Parameter Here]]]

dwData Required Long. [[[Describe Parameter Here]]]

plIndex Required Long. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


RegisterObject Method

[[[IObjPropManager Interface]]]

Syntax

expression.RegisterObject(dwKind)

expression Required. An expression that returns a IObjPropManager object.

dwKind Required Long. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


RegisterObjectProperties Method

[[[IObjPropManager Interface]]]

Syntax

expression.RegisterObjectProperties(dwKind, shSize, pdwPropIDs, pbEnableType, varDefVal, pshCount)

expression Required. An expression that returns a IObjPropManager object.

dwKind Required Long. [[[Describe Parameter Here]]]

shSize Required Integer. [[[Describe Parameter Here]]]

pdwPropIDs Required Long. [[[Describe Parameter Here]]]

pbEnableType Required Byte. [[[Describe Parameter Here]]]

varDefVal Required Variant. [[[Describe Parameter Here]]]

pshCount Required Integer. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


RegisterProperty Method

[[[IPropertyManager Interface]]]

Syntax

expression.RegisterProperty(lCatIndex, dwPropID, bstrIName, bstrUName, vtType, wCtrlType, pvarMinMax, wFlags, dwProvID, pIProv, dwData)

expression Required. An expression that returns a PropertyManager object.

lCatIndex Required Long. [[[Describe Parameter Here]]]

dwPropID Required Long. [[[Describe Parameter Here]]]

bstrIName Required String. [[[Describe Parameter Here]]]

bstrUName Required String. [[[Describe Parameter Here]]]

vtType Required Integer. [[[Describe Parameter Here]]]

wCtrlType Required Integer. [[[Describe Parameter Here]]]

pvarMinMax Required Variant. [[[Describe Parameter Here]]]

wFlags Required Integer. [[[Describe Parameter Here]]]

dwProvID Required Long. [[[Describe Parameter Here]]]

pIProv Required Object. [[[Describe Parameter Here]]]

dwData Required Long. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


ApplicationEvents Object

ApplicationEvents object

[[[describe object and uses here]]]


Ties Collection Object

Drawings collection (Drawing object)
TieSets collection (TieSet object)
Ties collection (Tie object)

[[[describe object and uses here]]]


ActiveWindow Property

[[[A TurboCAD drawing's Paper Space.]]]

Syntax

expression.ActiveWindow

expression Required. An expression that returns a PaperSpace object.

Remarks

[[[Insert Remarks Here]]]


BasedOn Property

[[[A TurboCAD style.]]]

Syntax

expression.BasedOn

expression Required. An expression that returns a Style object.

Remarks

[[[Insert Remarks Here]]]


BeginGroup Property

[[[A command bar control.]]]

Syntax

expression.BeginGroup

expression Required. An expression that returns a CommandBarControl object.

Remarks

[[[Insert Remarks Here]]]


Caption Property

[[[A command bar control.]]]

Syntax

expression.Caption

expression Required. An expression that returns a CommandBarControl object.

Remarks

[[[Insert Remarks Here]]]


Controls Property

[[[A command bar control.]]]

Syntax

expression.Controls

expression Required. An expression that returns a CommandBarControl object.

Remarks

[[[Insert Remarks Here]]]


CoordinateStyle Property

[[[Options that change session (Application object) behavior.]]]

Syntax

expression.CoordinateStyle

expression Required. An expression that returns a ApplicationOptions object.

Remarks

[[[Insert Remarks Here]]]


EntryName Property

[[[A generic TurboCAD table.]]]

Syntax

expression.EntryName(Index)

expression Required. An expression that returns a Table object.

Index Required Long. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


EntryValue Property

[[[A generic TurboCAD table.]]]

Syntax

expression.EntryValue(Index)

expression Required. An expression that returns a Table object.

Index Required Long. [[[Describe Parameter Here]]]

Remarks

[[[Insert Remarks Here]]]


Flag Property

Description missing

Syntax

expression.Flag(FlagMask)

expression Required. An expression that returns a TieSet object.

FlagMask Required __MIDL___MIDL_itf_GXTIES_0000_0001. Description missing


Flags Property

Description missing

Syntax

expression.Flags

expression Required. An expression that returns a TieSet object.


Height Property

[[[A customizable command bar.]]]

Syntax

expression.Height

expression Required. An expression that returns a CommandBar object.

Remarks

[[[Insert Remarks Here]]]


Left Property

[[[A TurboCAD window object.]]]

Syntax

expression.Left

expression Required. An expression that returns a Window object.

Remarks

[[[Insert Remarks Here]]]


OnAction Property

[[[Procedures triggered by Graphic object actions.]]]

Syntax

expression.OnAction

expression Required. An expression that returns a GraphicCallbacks object.

Remarks

[[[Insert Remarks Here]]]


OnData Property

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnData

expression Required. An expression that returns a ApplicationCallbacks object.

Remarks

[[[Insert Remarks Here]]]


OnDoubleClick Property

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnDoubleClick

expression Required. An expression that returns a ApplicationCallbacks object.

Remarks

[[[Insert Remarks Here]]]


OnDrawingActivate Property

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnDrawingActivate

expression Required. An expression that returns a ApplicationCallbacks object.

Remarks

[[[Insert Remarks Here]]]


OnDrawingDeactivate Property

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnDrawingDeactivate

expression Required. An expression that returns a ApplicationCallbacks object.

Remarks

[[[Insert Remarks Here]]]


OnEntry Property

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnEntry

expression Required. An expression that returns a ApplicationCallbacks object.

Remarks

[[[Insert Remarks Here]]]


OnWindow Property

[[[Procedures triggered by Application object actions.]]]

Syntax

expression.OnWindow

expression Required. An expression that returns a ApplicationCallbacks object.

Remarks

[[[Insert Remarks Here]]]


Parameter Property

[[[A command bar control.]]]

Syntax

expression.Parameter

expression Required. An expression that returns a CommandBarControl object.

Remarks

[[[Insert Remarks Here]]]


Provider Property

[[[Insert Description Here]]]

Syntax

expression.Provider

expression Required. An expression that returns a ObjProperty object.

Remarks

[[[Insert Remarks Here]]]


ReadOnly Property

[[[A named attribute of an object.]]]

Syntax

expression.ReadOnly

expression Required. An expression that returns a Property object.

Remarks

[[[Insert Remarks Here]]]


State Property

[[[Insert Description Here]]]

Syntax

expression.State

expression Required. An expression that returns a ObjProperty object.

Remarks

[[[Insert Remarks Here]]]


Styles Property

[[[A TurboCAD drawing.]]]

Syntax

expression.Styles

expression Required. An expression that returns a Drawing object.

Remarks

[[[Insert Remarks Here]]]


Tag Property

[[[A command bar control.]]]

Syntax

expression.Tag

expression Required. An expression that returns a CommandBarControl object.

Remarks

[[[Insert Remarks Here]]]


Tools Property

[[[The global (nameless, session) object.]]]

Syntax

Tools

Remarks

[[[Insert Remarks Here]]]


Top Property

[[[A command bar control.]]]

Syntax

expression.Top

expression Required. An expression that returns a CommandBarControl object.

Remarks

[[[Insert Remarks Here]]]


UsableHeight Property

[[[A TurboCAD window object.]]]

Syntax

expression.UsableHeight

expression Required. An expression that returns a Window object.

Remarks

[[[Insert Remarks Here]]]


UsableWidth Property

[[[A TurboCAD window object.]]]

Syntax

expression.UsableWidth

expression Required. An expression that returns a Window object.

Remarks

[[[Insert Remarks Here]]]


Width Property

[[[A TurboCAD window object.]]]

Syntax

expression.Width

expression Required. An expression that returns a Window object.

Remarks

[[[Insert Remarks Here]]]